1
#pragma once
2

            
3
#include "envoy/config/config_provider.h"
4
#include "envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.pb.h"
5
#include "envoy/http/early_header_mutation.h"
6
#include "envoy/http/filter.h"
7
#include "envoy/http/header_validator.h"
8
#include "envoy/http/original_ip_detection.h"
9
#include "envoy/http/request_id_extension.h"
10
#include "envoy/matcher/matcher.h"
11
#include "envoy/router/rds.h"
12
#include "envoy/router/scopes.h"
13
#include "envoy/stats/scope.h"
14
#include "envoy/tracing/tracer.h"
15
#include "envoy/type/v3/percent.pb.h"
16

            
17
#include "source/common/http/date_provider.h"
18
#include "source/common/local_reply/local_reply.h"
19
#include "source/common/network/utility.h"
20
#include "source/common/stats/symbol_table.h"
21
#include "source/common/tracing/tracer_config_impl.h"
22

            
23
#include "absl/container/flat_hash_map.h"
24
#include "absl/container/flat_hash_set.h"
25

            
26
namespace Envoy {
27
namespace Http {
28

            
29
/**
30
 * All stats for the connection manager. @see stats_macros.h
31
 */
32
#define ALL_HTTP_CONN_MAN_STATS(COUNTER, GAUGE, HISTOGRAM)                                         \
33
20946
  COUNTER(downstream_cx_delayed_close_timeout)                                                     \
34
20946
  COUNTER(downstream_cx_destroy)                                                                   \
35
20946
  COUNTER(downstream_cx_destroy_active_rq)                                                         \
36
20946
  COUNTER(downstream_cx_destroy_local)                                                             \
37
20946
  COUNTER(downstream_cx_destroy_local_active_rq)                                                   \
38
20946
  COUNTER(downstream_cx_destroy_remote)                                                            \
39
20946
  COUNTER(downstream_cx_destroy_remote_active_rq)                                                  \
40
20946
  COUNTER(downstream_cx_drain_close)                                                               \
41
20946
  COUNTER(downstream_cx_http1_total)                                                               \
42
20946
  COUNTER(downstream_cx_http2_total)                                                               \
43
20946
  COUNTER(downstream_cx_http3_total)                                                               \
44
20946
  COUNTER(downstream_cx_idle_timeout)                                                              \
45
20946
  COUNTER(downstream_cx_max_duration_reached)                                                      \
46
20946
  COUNTER(downstream_cx_max_requests_reached)                                                      \
47
20946
  COUNTER(downstream_cx_overload_disable_keepalive)                                                \
48
20946
  COUNTER(downstream_cx_protocol_error)                                                            \
49
20946
  COUNTER(downstream_cx_rx_bytes_total)                                                            \
50
20946
  COUNTER(downstream_cx_ssl_total)                                                                 \
51
20946
  COUNTER(downstream_cx_total)                                                                     \
52
20946
  COUNTER(downstream_cx_tx_bytes_total)                                                            \
53
20946
  COUNTER(downstream_cx_upgrades_total)                                                            \
54
20946
  COUNTER(downstream_flow_control_paused_reading_total)                                            \
55
20946
  COUNTER(downstream_flow_control_resumed_reading_total)                                           \
56
20946
  COUNTER(downstream_rq_1xx)                                                                       \
57
20946
  COUNTER(downstream_rq_2xx)                                                                       \
58
20946
  COUNTER(downstream_rq_3xx)                                                                       \
59
20946
  COUNTER(downstream_rq_4xx)                                                                       \
60
20946
  COUNTER(downstream_rq_5xx)                                                                       \
61
20946
  COUNTER(downstream_rq_completed)                                                                 \
62
20946
  COUNTER(downstream_rq_failed_path_normalization)                                                 \
63
20946
  COUNTER(downstream_rq_http1_total)                                                               \
64
20946
  COUNTER(downstream_rq_http2_total)                                                               \
65
20946
  COUNTER(downstream_rq_http3_total)                                                               \
66
20946
  COUNTER(downstream_rq_idle_timeout)                                                              \
67
20946
  COUNTER(downstream_rq_non_relative_path)                                                         \
68
20946
  COUNTER(downstream_rq_overload_close)                                                            \
69
20946
  COUNTER(downstream_rq_redirected_with_normalized_path)                                           \
70
20946
  COUNTER(downstream_rq_rejected_via_ip_detection)                                                 \
71
20946
  COUNTER(downstream_rq_response_before_rq_complete)                                               \
72
20946
  COUNTER(downstream_rq_rx_reset)                                                                  \
73
20946
  COUNTER(downstream_rq_too_many_premature_resets)                                                 \
74
20946
  COUNTER(downstream_rq_timeout)                                                                   \
75
20946
  COUNTER(downstream_rq_header_timeout)                                                            \
76
20946
  COUNTER(downstream_rq_too_large)                                                                 \
77
20946
  COUNTER(downstream_rq_total)                                                                     \
78
20946
  COUNTER(downstream_rq_tx_reset)                                                                  \
79
20946
  COUNTER(downstream_rq_max_duration_reached)                                                      \
80
20946
  COUNTER(downstream_rq_ws_on_non_ws_route)                                                        \
81
20946
  COUNTER(rs_too_large)                                                                            \
82
20946
  GAUGE(downstream_cx_active, Accumulate)                                                          \
83
20946
  GAUGE(downstream_cx_http1_active, Accumulate)                                                    \
84
20946
  GAUGE(downstream_cx_http2_active, Accumulate)                                                    \
85
20946
  GAUGE(downstream_cx_http3_active, Accumulate)                                                    \
86
20946
  GAUGE(downstream_cx_rx_bytes_buffered, Accumulate)                                               \
87
20946
  GAUGE(downstream_cx_ssl_active, Accumulate)                                                      \
88
20946
  GAUGE(downstream_cx_tx_bytes_buffered, Accumulate)                                               \
89
20946
  GAUGE(downstream_cx_upgrades_active, Accumulate)                                                 \
90
20946
  GAUGE(downstream_cx_http1_soft_drain, Accumulate)                                                \
91
20946
  GAUGE(downstream_rq_active, Accumulate)                                                          \
92
20946
  HISTOGRAM(downstream_cx_length_ms, Milliseconds)                                                 \
93
20946
  HISTOGRAM(downstream_rq_time, Milliseconds)
94

            
95
/**
96
 * Wrapper struct for connection manager stats. @see stats_macros.h
97
 */
98
struct ConnectionManagerNamedStats {
99
  ALL_HTTP_CONN_MAN_STATS(GENERATE_COUNTER_STRUCT, GENERATE_GAUGE_STRUCT, GENERATE_HISTOGRAM_STRUCT)
100
};
101

            
102
struct ConnectionManagerStats {
103
  ConnectionManagerStats(ConnectionManagerNamedStats&& named_stats, const std::string& prefix,
104
                         Stats::Scope& scope)
105
20946
      : named_(std::move(named_stats)), prefix_(prefix),
106
20946
        prefix_stat_name_storage_(prefix, scope.symbolTable()), scope_(scope) {}
107

            
108
91418
  Stats::StatName prefixStatName() const { return prefix_stat_name_storage_.statName(); }
109

            
110
  ConnectionManagerNamedStats named_;
111
  std::string prefix_;
112
  Stats::StatNameManagedStorage prefix_stat_name_storage_;
113
  Stats::Scope& scope_;
114
};
115

            
116
/**
117
 * Connection manager tracing specific stats. @see stats_macros.h
118
 */
119
#define CONN_MAN_TRACING_STATS(COUNTER)                                                            \
120
20711
  COUNTER(random_sampling)                                                                         \
121
20711
  COUNTER(service_forced)                                                                          \
122
20711
  COUNTER(client_enabled)                                                                          \
123
20711
  COUNTER(not_traceable)                                                                           \
124
20711
  COUNTER(health_check)
125

            
126
/**
127
 * Wrapper struct for connection manager tracing stats. @see stats_macros.h
128
 */
129
struct ConnectionManagerTracingStats {
130
  CONN_MAN_TRACING_STATS(GENERATE_COUNTER_STRUCT)
131
};
132

            
133
using TracingConnectionManagerConfig = Tracing::ConnectionManagerTracingConfig;
134
using TracingConnectionManagerConfigPtr = std::unique_ptr<TracingConnectionManagerConfig>;
135

            
136
/**
137
 * Connection manager per listener stats. @see stats_macros.h
138
 */
139
#define CONN_MAN_LISTENER_STATS(COUNTER)                                                           \
140
20908
  COUNTER(downstream_rq_1xx)                                                                       \
141
20908
  COUNTER(downstream_rq_2xx)                                                                       \
142
20908
  COUNTER(downstream_rq_3xx)                                                                       \
143
20908
  COUNTER(downstream_rq_4xx)                                                                       \
144
20908
  COUNTER(downstream_rq_5xx)                                                                       \
145
20908
  COUNTER(downstream_rq_completed)
146

            
147
/**
148
 * Wrapper struct for connection manager listener stats. @see stats_macros.h
149
 */
150
struct ConnectionManagerListenerStats {
151
  CONN_MAN_LISTENER_STATS(GENERATE_COUNTER_STRUCT)
152
};
153

            
154
/**
155
 * Configuration for how to forward client certs.
156
 */
157
enum class ForwardClientCertType {
158
  ForwardOnly,
159
  AppendForward,
160
  SanitizeSet,
161
  Sanitize,
162
  AlwaysForwardOnly
163
};
164

            
165
/**
166
 * Configuration for the fields of the client cert, used for populating the current client cert
167
 * information to the next hop.
168
 */
169
enum class ClientCertDetailsType { Cert, Chain, Subject, URI, DNS };
170

            
171
/**
172
 * Type that indicates how port should be stripped from Host header.
173
 */
174
enum class StripPortType {
175
  // Removes the port from host/authority header only if the port matches with the listener port.
176
  MatchingHost,
177
  // Removes any port from host/authority header.
178
  Any,
179
  // Keeps the port in host/authority header as is.
180
  None
181
};
182

            
183
/**
184
 * Configuration for what addresses should be considered internal beyond the defaults.
185
 */
186
class InternalAddressConfig {
187
public:
188
21080
  virtual ~InternalAddressConfig() = default;
189
  virtual bool isInternalAddress(const Network::Address::Instance& address) const PURE;
190
};
191

            
192
/**
193
 * Determines if an address is internal based on whether it is an RFC1918 ip address.
194
 */
195
class DefaultInternalAddressConfig : public Http::InternalAddressConfig {
196
public:
197
280
  bool isInternalAddress(const Network::Address::Instance&) const override { return false; }
198
};
199

            
200
/**
201
 * Abstract configuration for the connection manager.
202
 */
203
class ConnectionManagerConfig {
204
public:
205
  using HttpConnectionManagerProto =
206
      envoy::extensions::filters::network::http_connection_manager::v3::HttpConnectionManager;
207

            
208
21315
  virtual ~ConnectionManagerConfig() = default;
209

            
210
  /**
211
   * @return RequestIDExtensionSharedPtr The request id utilities instance to use.
212
   */
213
  virtual const RequestIDExtensionSharedPtr& requestIDExtension() PURE;
214

            
215
  /**
216
   *  @return const std::list<AccessLog::InstanceSharedPtr>& the access logs to write to.
217
   */
218
  virtual const AccessLog::InstanceSharedPtrVector& accessLogs() PURE;
219

            
220
  /**
221
   * @return const absl::optional<std::chrono::milliseconds>& the interval to flush the access logs.
222
   */
223
  virtual const absl::optional<std::chrono::milliseconds>& accessLogFlushInterval() PURE;
224

            
225
  // If set to true, access log will be flushed when a new HTTP request is received, after request
226
  // headers have been evaluated, and before attempting to establish a connection with the upstream.
227
  virtual bool flushAccessLogOnNewRequest() PURE;
228

            
229
  virtual bool flushAccessLogOnTunnelSuccessfullyEstablished() const PURE;
230

            
231
  /**
232
   * Called to create a codec for the connection manager. This function will be called when the
233
   * first byte of application data is received. This is done to support handling of ALPN, protocol
234
   * detection, etc.
235
   * @param connection supplies the owning connection.
236
   * @param data supplies the currently available read data.
237
   * @param callbacks supplies the callbacks to install into the codec.
238
   * @param overload_manager supplies overload manager that the codec can
239
   * integrate with.
240
   * @return a codec or nullptr if no codec can be created.
241
   */
242
  virtual ServerConnectionPtr createCodec(Network::Connection& connection,
243
                                          const Buffer::Instance& data,
244
                                          ServerConnectionCallbacks& callbacks,
245
                                          Server::OverloadManager& overload_manager) PURE;
246

            
247
  /**
248
   * @return DateProvider& the date provider to use for
249
   */
250
  virtual DateProvider& dateProvider() PURE;
251

            
252
  /**
253
   * @return the time in milliseconds the connection manager will wait between issuing a "shutdown
254
   *         notice" to the time it will issue a full GOAWAY and not accept any new streams.
255
   */
256
  virtual std::chrono::milliseconds drainTimeout() const PURE;
257

            
258
  /**
259
   * @return FilterChainFactory& the HTTP level filter factory to build the connection's filter
260
   *         chain.
261
   */
262
  virtual FilterChainFactory& filterFactory() PURE;
263

            
264
  /**
265
   * @return whether the connection manager will generate a fresh x-request-id if the request does
266
   *         not have one.
267
   */
268
  virtual bool generateRequestId() const PURE;
269

            
270
  /**
271
   * @return whether the x-request-id should not be reset on edge entry inside mesh
272
   */
273
  virtual bool preserveExternalRequestId() const PURE;
274

            
275
  /**
276
   * @return whether the x-request-id should always be set in the response.
277
   */
278
  virtual bool alwaysSetRequestIdInResponse() const PURE;
279

            
280
  /**
281
   * @return optional idle timeout for incoming connection manager connections.
282
   */
283
  virtual absl::optional<std::chrono::milliseconds> idleTimeout() const PURE;
284

            
285
  /**
286
   * @return if the connection manager does routing base on router config, e.g. a Server::Admin impl
287
   * has no route config.
288
   */
289
  virtual bool isRoutable() const PURE;
290

            
291
  /**
292
   * @return optional maximum connection duration timeout for manager connections.
293
   */
294
  virtual absl::optional<std::chrono::milliseconds> maxConnectionDuration() const PURE;
295

            
296
  /**
297
   * @return whether maxConnectionDuration allows HTTP1 clients to choose when to close connection
298
   *         (rather than Envoy closing the connection itself when there are no active streams).
299
   */
300
  virtual bool http1SafeMaxConnectionDuration() const PURE;
301

            
302
  /**
303
   * @return maximum request headers size the connection manager will accept.
304
   */
305
  virtual uint32_t maxRequestHeadersKb() const PURE;
306

            
307
  /**
308
   * @return maximum number of request headers the codecs will accept.
309
   */
310
  virtual uint32_t maxRequestHeadersCount() const PURE;
311

            
312
  /**
313
   * @return per-stream idle timeout for incoming connection manager connections. Zero indicates a
314
   *         disabled idle timeout.
315
   */
316
  virtual std::chrono::milliseconds streamIdleTimeout() const PURE;
317

            
318
  /**
319
   * @return per-stream flush timeout for incoming connection manager connections. Zero indicates a
320
   *         disabled idle timeout.
321
   */
322
  virtual absl::optional<std::chrono::milliseconds> streamFlushTimeout() const PURE;
323

            
324
  /**
325
   * @return request timeout for incoming connection manager connections. Zero indicates
326
   *         a disabled request timeout.
327
   */
328
  virtual std::chrono::milliseconds requestTimeout() const PURE;
329

            
330
  /**
331
   * @return request header timeout for incoming connection manager connections. Zero indicates a
332
   *         disabled request header timeout.
333
   */
334
  virtual std::chrono::milliseconds requestHeadersTimeout() const PURE;
335

            
336
  /**
337
   * @return delayed close timeout for downstream HTTP connections. Zero indicates a disabled
338
   *         timeout. See http_connection_manager.proto for a detailed description of this timeout.
339
   */
340
  virtual std::chrono::milliseconds delayedCloseTimeout() const PURE;
341

            
342
  /**
343
   * @return maximum duration time to keep alive stream
344
   */
345
  virtual absl::optional<std::chrono::milliseconds> maxStreamDuration() const PURE;
346

            
347
  /**
348
   * @return Router::RouteConfigProvider* the configuration provider used to acquire a route
349
   *         config for each request flow. Pointer ownership is _not_ transferred to the caller of
350
   *         this function. This will return nullptr when scoped routing is enabled.
351
   */
352
  virtual Router::RouteConfigProvider* routeConfigProvider() PURE;
353

            
354
  /**
355
   * @return Config::ConfigProvider* the configuration provider used to acquire scoped routing
356
   * configuration for each request flow. Pointer ownership is _not_ transferred to the caller of
357
   * this function. This will return nullptr when scoped routing is not enabled.
358
   */
359
  virtual Config::ConfigProvider* scopedRouteConfigProvider() PURE;
360

            
361
  /**
362
   * @return OptRef<Router::ScopeKeyBuilder> the scope key builder to calculate the scope key.
363
   * This will return nullptr when scoped routing is not enabled.
364
   */
365
  virtual OptRef<const Router::ScopeKeyBuilder> scopeKeyBuilder() PURE;
366

            
367
  /**
368
   * @return const std::string& the server name to write into responses.
369
   */
370
  virtual const std::string& serverName() const PURE;
371

            
372
  /**
373
   * @return ServerHeaderTransformation the transformation to apply to Server response headers.
374
   */
375
  virtual HttpConnectionManagerProto::ServerHeaderTransformation
376
  serverHeaderTransformation() const PURE;
377

            
378
  /**
379
   * @return const absl::optional<std::string> the scheme name to write into requests.
380
   */
381
  virtual const absl::optional<std::string>& schemeToSet() const PURE;
382

            
383
  /**
384
   * @return bool whether the scheme should be overwritten to match the upstream transport protocol.
385
   */
386
  virtual bool shouldSchemeMatchUpstream() const PURE;
387

            
388
  /**
389
   * @return ConnectionManagerStats& the stats to write to.
390
   */
391
  virtual ConnectionManagerStats& stats() PURE;
392

            
393
  /**
394
   * @return ConnectionManagerTracingStats& the stats to write to.
395
   */
396
  virtual ConnectionManagerTracingStats& tracingStats() PURE;
397

            
398
  /**
399
   * @return bool whether to use the remote address for populating XFF, determining internal request
400
   *         status, etc. or to assume that XFF will already be populated with the remote address.
401
   */
402
  virtual bool useRemoteAddress() const PURE;
403

            
404
  /**
405
   * @return InternalAddressConfig configuration for user defined internal addresses.
406
   */
407
  virtual const InternalAddressConfig& internalAddressConfig() const PURE;
408

            
409
  /**
410
   * @return uint32_t the number of trusted proxy hops in front of this Envoy instance, for
411
   *         the purposes of XFF processing.
412
   */
413
  virtual uint32_t xffNumTrustedHops() const PURE;
414

            
415
  /**
416
   * @return bool don't append the remote address to XFF? This overrides the behavior of
417
   *              useRemoteAddress() and may be used when XFF should not be modified but we still
418
   *              want to avoid trusting incoming XFF in remote IP determination.
419
   */
420
  virtual bool skipXffAppend() const PURE;
421

            
422
  /**
423
   * @return const absl::optional<std::string>& value of via header to add to requests and response
424
   *                                            headers if set.
425
   */
426
  virtual const std::string& via() const PURE;
427

            
428
  /**
429
   * @return ForwardClientCertType the configuration of how to forward the client cert information.
430
   */
431
  virtual ForwardClientCertType forwardClientCert() const PURE;
432

            
433
  /**
434
   * @return vector of ClientCertDetailsType the configuration of the current client cert's details
435
   * to be forwarded.
436
   */
437
  virtual const std::vector<ClientCertDetailsType>& setCurrentClientCertDetails() const PURE;
438

            
439
  /**
440
   * @return the matcher for selecting forward client cert config per-request. Returns nullptr
441
   * if no matcher is configured, in which case the static forwardClientCert() and
442
   * setCurrentClientCertDetails() should be used.
443
   */
444
  virtual const Matcher::MatchTreePtr<HttpMatchingData>& forwardClientCertMatcher() const PURE;
445

            
446
  /**
447
   * @return local address.
448
   * Gives richer information in case of internal requests.
449
   */
450
  virtual const Network::Address::Instance& localAddress() PURE;
451

            
452
  /**
453
   * @return custom user agent for internal requests for better debugging. Must be configured to
454
   *         be enabled. User agent will only overwritten if it doesn't already exist. If enabled,
455
   *         the same user agent will be written to the x-envoy-downstream-service-cluster header.
456
   */
457
  virtual const absl::optional<std::string>& userAgent() PURE;
458

            
459
  /**
460
   *  @return TracerSharedPtr Tracer to use.
461
   */
462
  virtual Tracing::TracerSharedPtr tracer() PURE;
463

            
464
  /**
465
   * @return tracing config.
466
   */
467
  virtual const TracingConnectionManagerConfig* tracingConfig() PURE;
468

            
469
  /**
470
   * @return ConnectionManagerListenerStats& the stats to write to.
471
   */
472
  virtual ConnectionManagerListenerStats& listenerStats() PURE;
473

            
474
  /**
475
   * @return bool supplies if the HttpConnectionManager should proxy the Expect: 100-Continue
476
   */
477
  virtual bool proxy100Continue() const PURE;
478

            
479
  /**
480
   * @return bool supplies if the HttpConnectionManager should handle invalid HTTP with a stream
481
   * error or connection error.
482
   */
483
  virtual bool streamErrorOnInvalidHttpMessaging() const PURE;
484

            
485
  /**
486
   * @return supplies the http1 settings.
487
   */
488
  virtual const Http::Http1Settings& http1Settings() const PURE;
489

            
490
  /**
491
   * @return if the HttpConnectionManager should normalize url following RFC3986
492
   */
493
  virtual bool shouldNormalizePath() const PURE;
494

            
495
  /**
496
   * @return if the HttpConnectionManager should merge two or more adjacent slashes in the path into
497
   * one.
498
   */
499
  virtual bool shouldMergeSlashes() const PURE;
500

            
501
  /**
502
   * @return port strip type from host/authority header.
503
   */
504
  virtual StripPortType stripPortType() const PURE;
505

            
506
  /**
507
   * @return the action HttpConnectionManager should take when receiving client request
508
   * headers containing underscore characters.
509
   */
510
  virtual envoy::config::core::v3::HttpProtocolOptions::HeadersWithUnderscoresAction
511
  headersWithUnderscoresAction() const PURE;
512

            
513
  /**
514
   * @return LocalReply configuration which supplies mapping for local reply generated by Envoy.
515
   */
516
  virtual const LocalReply::LocalReply& localReply() const PURE;
517

            
518
  /**
519
   * @return the action HttpConnectionManager should take when receiving client request
520
   * with URI path containing %2F, %2f, %5c or %5C sequences.
521
   */
522
  virtual envoy::extensions::filters::network::http_connection_manager::v3::HttpConnectionManager::
523
      PathWithEscapedSlashesAction
524
      pathWithEscapedSlashesAction() const PURE;
525

            
526
  /**
527
   * @return vector of OriginalIPDetectionSharedPtr original IP detection extensions.
528
   */
529
  virtual const std::vector<OriginalIPDetectionSharedPtr>&
530
  originalIpDetectionExtensions() const PURE;
531

            
532
  virtual const std::vector<EarlyHeaderMutationPtr>& earlyHeaderMutationExtensions() const PURE;
533

            
534
  /**
535
   * @return if the HttpConnectionManager should remove trailing host dot from host/authority
536
   * header.
537
   */
538
  virtual bool shouldStripTrailingHostDot() const PURE;
539
  /**
540
   * @return maximum requests for downstream.
541
   */
542
  virtual uint32_t maxRequestsPerConnection() const PURE;
543
  /**
544
   * @return the config describing if/how to write the Proxy-Status HTTP response header.
545
   * If nullptr, don't write the Proxy-Status HTTP response header.
546
   */
547
  virtual const HttpConnectionManagerProto::ProxyStatusConfig* proxyStatusConfig() const PURE;
548

            
549
  /**
550
   * Creates new header validator. This method always returns nullptr unless the `ENVOY_ENABLE_UHV`
551
   * pre-processor variable is defined.
552
   * @param protocol HTTP protocol version that is to be validated.
553
   * @return pointer to the header validator.
554
   *         If nullptr, header validation will not be done.
555
   */
556
  virtual ServerHeaderValidatorPtr makeHeaderValidator(Protocol protocol) PURE;
557

            
558
  /**
559
   * @return whether to append the x-forwarded-port header.
560
   */
561
  virtual bool appendXForwardedPort() const PURE;
562

            
563
  /**
564
   * @return whether to append the overload header to a local reply of a request which
565
   * has been dropped due to Overload Manager.
566
   */
567
  virtual bool appendLocalOverload() const PURE;
568

            
569
  /**
570
   * @return whether the HCM will insert ProxyProtocolFilterState into the filter state at the
571
   *         Connection Lifetime.
572
   */
573
  virtual bool addProxyProtocolConnectionState() const PURE;
574

            
575
  /**
576
   * @return a set of destination ports that should be treated as HTTPS when the
577
   *         local address was restored from PROXY protocol.
578
   */
579
  virtual const absl::flat_hash_set<uint32_t>& httpsDestinationPorts() const PURE;
580

            
581
  /**
582
   * @return a set of destination ports that should be treated as HTTP when the
583
   *         local address was restored from PROXY protocol.
584
   */
585
  virtual const absl::flat_hash_set<uint32_t>& httpDestinationPorts() const PURE;
586
};
587

            
588
using ConnectionManagerConfigSharedPtr = std::shared_ptr<ConnectionManagerConfig>;
589
} // namespace Http
590
} // namespace Envoy