-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathtypes.go
More file actions
40 lines (33 loc) · 1.09 KB
/
types.go
File metadata and controls
40 lines (33 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package egressproxy
import "errors"
const (
DefaultListenPort = 18080
)
var (
ErrGatewayMismatch = errors.New("egress proxy already initialized with different gateway")
ErrInstanceNotRegistered = errors.New("instance not registered with egress proxy")
)
// InstanceConfig defines per-instance proxy behavior.
type InstanceConfig struct {
InstanceID string
SourceIP string
TAPDevice string
BlockAllTCPEgress bool
HeaderInjectRules []HeaderInjectRuleConfig
}
// HeaderInjectRuleConfig defines one host-managed outbound header injection policy.
type HeaderInjectRuleConfig struct {
HeaderName string
HeaderValue string
AllowedDomains []string // optional exact or *.example.com patterns; empty means allow all
}
// ServiceOptions customizes service construction (primarily for tests).
type ServiceOptions struct {
AdditionalRootCAPEM []string
}
// GuestConfig is injected into guest config.json when proxy mode is enabled.
type GuestConfig struct {
Enabled bool `json:"enabled"`
ProxyURL string `json:"proxy_url"`
CACertPEM string `json:"ca_cert_pem"`
}