MCPcopy
hub / github.com/cloudflare/cloudflared / originRequestFromSingleRule

Function originRequestFromSingleRule

ingress/config.go:122–213  ·  view source on GitHub ↗
(c *cli.Context)

Source from the content-addressed store, hash-verified

120}
121
122func originRequestFromSingleRule(c *cli.Context) OriginRequestConfig {
123 var connectTimeout = defaultHTTPConnectTimeout
124 var tlsTimeout = defaultTLSTimeout
125 var tcpKeepAlive = defaultTCPKeepAlive
126 var noHappyEyeballs bool
127 var keepAliveConnections = defaultKeepAliveConnections
128 var keepAliveTimeout = defaultKeepAliveTimeout
129 var httpHostHeader string
130 var originServerName string
131 var matchSNItoHost bool
132 var caPool string
133 var noTLSVerify bool
134 var disableChunkedEncoding bool
135 var bastionMode bool
136 var proxyAddress = defaultProxyAddress
137 var proxyPort uint
138 var proxyType string
139 var http2Origin bool
140 if flag := ProxyConnectTimeoutFlag; c.IsSet(flag) {
141 connectTimeout = config.CustomDuration{Duration: c.Duration(flag)}
142 }
143 if flag := ProxyTLSTimeoutFlag; c.IsSet(flag) {
144 tlsTimeout = config.CustomDuration{Duration: c.Duration(flag)}
145 }
146 if flag := ProxyTCPKeepAliveFlag; c.IsSet(flag) {
147 tcpKeepAlive = config.CustomDuration{Duration: c.Duration(flag)}
148 }
149 if flag := ProxyNoHappyEyeballsFlag; c.IsSet(flag) {
150 noHappyEyeballs = c.Bool(flag)
151 }
152 if flag := ProxyKeepAliveConnectionsFlag; c.IsSet(flag) {
153 keepAliveConnections = c.Int(flag)
154 }
155 if flag := ProxyKeepAliveTimeoutFlag; c.IsSet(flag) {
156 keepAliveTimeout = config.CustomDuration{Duration: c.Duration(flag)}
157 }
158 if flag := HTTPHostHeaderFlag; c.IsSet(flag) {
159 httpHostHeader = c.String(flag)
160 }
161 if flag := OriginServerNameFlag; c.IsSet(flag) {
162 originServerName = c.String(flag)
163 }
164 if flag := MatchSNIToHostFlag; c.IsSet(flag) {
165 matchSNItoHost = c.Bool(flag)
166 }
167 if flag := tlsconfig.OriginCAPoolFlag; c.IsSet(flag) {
168 caPool = c.String(flag)
169 }
170 if flag := NoTLSVerifyFlag; c.IsSet(flag) {
171 noTLSVerify = c.Bool(flag)
172 }
173 if flag := NoChunkedEncodingFlag; c.IsSet(flag) {
174 disableChunkedEncoding = c.Bool(flag)
175 }
176 if flag := config.BastionFlag; c.IsSet(flag) {
177 bastionMode = c.Bool(flag)
178 }
179 if flag := ProxyAddressFlag; c.IsSet(flag) {

Callers 3

TestDefaultConfigFromCLIFunction · 0.85
parseCLIIngressFunction · 0.85
newDefaultOriginFunction · 0.85

Calls 4

DurationMethod · 0.80
BoolMethod · 0.80
IntMethod · 0.80
StringMethod · 0.65

Tested by 1

TestDefaultConfigFromCLIFunction · 0.68