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

Function originRequestFromConfig

ingress/config.go:215–287  ·  view source on GitHub ↗
(c config.OriginRequestConfig)

Source from the content-addressed store, hash-verified

213}
214
215func originRequestFromConfig(c config.OriginRequestConfig) OriginRequestConfig {
216 out := OriginRequestConfig{
217 ConnectTimeout: defaultHTTPConnectTimeout,
218 TLSTimeout: defaultTLSTimeout,
219 TCPKeepAlive: defaultTCPKeepAlive,
220 KeepAliveConnections: defaultKeepAliveConnections,
221 KeepAliveTimeout: defaultKeepAliveTimeout,
222 ProxyAddress: defaultProxyAddress,
223 }
224 if c.ConnectTimeout != nil {
225 out.ConnectTimeout = *c.ConnectTimeout
226 }
227 if c.TLSTimeout != nil {
228 out.TLSTimeout = *c.TLSTimeout
229 }
230 if c.TCPKeepAlive != nil {
231 out.TCPKeepAlive = *c.TCPKeepAlive
232 }
233 if c.NoHappyEyeballs != nil {
234 out.NoHappyEyeballs = *c.NoHappyEyeballs
235 }
236 if c.KeepAliveConnections != nil {
237 out.KeepAliveConnections = *c.KeepAliveConnections
238 }
239 if c.KeepAliveTimeout != nil {
240 out.KeepAliveTimeout = *c.KeepAliveTimeout
241 }
242 if c.HTTPHostHeader != nil {
243 out.HTTPHostHeader = *c.HTTPHostHeader
244 }
245 if c.OriginServerName != nil {
246 out.OriginServerName = *c.OriginServerName
247 }
248 if c.MatchSNIToHost != nil {
249 out.MatchSNIToHost = *c.MatchSNIToHost
250 }
251 if c.CAPool != nil {
252 out.CAPool = *c.CAPool
253 }
254 if c.NoTLSVerify != nil {
255 out.NoTLSVerify = *c.NoTLSVerify
256 }
257 if c.DisableChunkedEncoding != nil {
258 out.DisableChunkedEncoding = *c.DisableChunkedEncoding
259 }
260 if c.BastionMode != nil {
261 out.BastionMode = *c.BastionMode
262 }
263 if c.ProxyAddress != nil {
264 out.ProxyAddress = *c.ProxyAddress
265 }
266 if c.ProxyPort != nil {
267 out.ProxyPort = *c.ProxyPort
268 }
269 if c.ProxyType != nil {
270 out.ProxyType = *c.ProxyType
271 }
272 if len(c.IPRules) > 0 {

Callers 4

ParseIngressFunction · 0.85
TestMarshalJSONFunction · 0.85
UnmarshalJSONMethod · 0.85
TestParseIngressFunction · 0.85

Calls 1

NewRuleByCIDRFunction · 0.92

Tested by 2

TestMarshalJSONFunction · 0.68
TestParseIngressFunction · 0.68