Skip to content

Commit a9567a2

Browse files
authored
Merge pull request #31 from serverscom/add-real-ip-header
add real ip header for LB
2 parents 7564af8 + 751cfdc commit a9567a2

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

pkg/types.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ import (
44
"time"
55
)
66

7+
const (
8+
RealIP RealIPHeaderName = "real_ip"
9+
ForwardedFor RealIPHeaderName = "forwarded_for"
10+
)
11+
712
// Location represents location
813
type Location struct {
914
ID int64 `json:"id"`
@@ -760,6 +765,7 @@ type L7VHostZoneInput struct {
760765
Domains []string `json:"domains"`
761766
SSLCertID string `json:"ssl_certificate_id"`
762767
LocationZones []L7LocationZoneInput `json:"location_zones"`
768+
RealIPHeader *RealIPHeader `json:"real_ip_header,omitempty"`
763769
}
764770

765771
// L7UpstreamInput represents l7 upstream input
@@ -1023,3 +1029,12 @@ type Invoice struct {
10231029
CsvUrl string `json:"csv_url"`
10241030
PdfUrl string `json:"pdf_url"`
10251031
}
1032+
1033+
// RealIPHeaderName represents real IP header name
1034+
type RealIPHeaderName string
1035+
1036+
// RealIPHeader represents real IP header
1037+
type RealIPHeader struct {
1038+
Name RealIPHeaderName `json:"name"`
1039+
Networks []string `json:"networks"`
1040+
}

0 commit comments

Comments
 (0)