Repository navigation
Expand file tree
/
Copy pathcommand.proto
More file actions
2698 lines (2568 loc) · 132 KB
/
Copy pathcommand.proto
File metadata and controls
2698 lines (2568 loc) · 132 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
syntax = "proto2";
package command;
// JSON state-file forward compat: `SaveState`/`LoadState` write
// `WorkerRequest`s as `\n\0`-separated JSON records. Older clients (e.g.
// `sozu-command-lib = "1.1.1"`) emit only the field set their schema knew,
// so missing `repeated` / `map` fields must default to empty when the
// current schema deserializes them. New schema rules:
// - new fields must be additive — proto2 `optional`, or `repeated`/`map`,
// - never rename or change the type of an existing field,
// - when adding a `repeated` or `map` field to a message that appears in
// a state file (anything emitted by `ConfigState::generate_requests` or
// carried in a `RequestType` an external client may build), add the
// matching `field_attribute(... "#[serde(default)]")` line in
// `command/build.rs`. Required scalars stay strict on purpose so
// malformed records still fail before dispatch.
// Regression guard: `command/tests/state_compat_v1_1_1.rs`.
// A message received by Sōzu to change its state or query information
message Request {
oneof request_type {
// This message tells Sōzu to dump the current proxy state (backends,
// front domains, certificates, etc) as a list of JSON-serialized Requests,
// separated by a 0 byte, to a file. This file can be used later
// to bootstrap the proxy. This message is not forwarded to workers.
// If the specified path is relative, it will be calculated relative to the current
// working directory of the proxy.
string save_state = 1;
// load a state file, given its path
string load_state = 2;
// list the workers and their status
ListWorkers list_workers = 4;
// list the frontends, filtered by protocol and/or domain
FrontendFilters list_frontends = 5;
// list all listeners
ListListeners list_listeners = 6;
// launch a new worker
// never implemented, the tag is unused and probably not needed
// we may still implement it later with no paramater
// the main process will automatically assign a new id to a new worker
string launch_worker = 7;
// upgrade the main process
UpgradeMain upgrade_main = 8;
// upgrade an existing worker, giving its id
uint32 upgrade_worker = 9;
// subscribe to proxy events
SubscribeEvents subscribe_events = 10;
// reload the configuration from the config file, or a new file
// CHECK: this used to be an option. None => use the config file, Some(string) => path_to_file
// make sure it works using "" and "path_to_file"
string reload_configuration = 11;
// give status of main process and all workers
Status status = 12;
// add a cluster
Cluster add_cluster = 13;
// remove a cluster giving its id, with every HTTP, HTTPS, TCP and UDP
// frontend and every backend that names it (a frontend without a
// cluster_id stays)
string remove_cluster = 14;
// add an HTTP frontend
RequestHttpFrontend add_http_frontend = 15;
// remove an HTTP frontend
RequestHttpFrontend remove_http_frontend = 16;
// add an HTTPS frontend
RequestHttpFrontend add_https_frontend = 17;
// remove an HTTPS frontend
RequestHttpFrontend remove_https_frontend = 18;
// add a certificate
AddCertificate add_certificate = 19;
// replace a certificate
ReplaceCertificate replace_certificate = 20;
// remove a certificate
RemoveCertificate remove_certificate = 21;
// add a TCP frontend
RequestTcpFrontend add_tcp_frontend = 22;
// remove a TCP frontend
RequestTcpFrontend remove_tcp_frontend = 23;
// add a backend to an existing cluster: a backend naming a cluster that
// was never added, or was removed, is refused
AddBackend add_backend = 24;
// remove a backend
RemoveBackend remove_backend = 25;
// add an HTTP listener
HttpListenerConfig add_http_listener = 26;
// add an HTTPS listener
HttpsListenerConfig add_https_listener = 27;
// add a TCP listener
TcpListenerConfig add_tcp_listener = 28;
// remove a listener
RemoveListener remove_listener = 29;
// activate a listener
ActivateListener activate_listener = 30;
// deactivate a listener
DeactivateListener deactivate_listener = 31;
// query a cluster by id
string query_cluster_by_id = 35;
// query clusters with a hostname and optional path
QueryClusterByDomain query_clusters_by_domain = 36;
// query clusters hashes
QueryClustersHashes query_clusters_hashes = 37;
// query metrics
QueryMetricsOptions query_metrics = 38;
// soft stop
SoftStop soft_stop = 39;
// hard stop
HardStop hard_stop = 40;
// enable, disable or clear the metrics
MetricsConfiguration configure_metrics = 41;
// Change the logging level
string Logging = 42;
// Return the listen sockets
ReturnListenSockets return_listen_sockets = 43;
// Get certificates from the state (rather than from the workers)
QueryCertificatesFilters query_certificates_from_the_state = 44;
// Get certificates from the workers (rather than from the state)
QueryCertificatesFilters query_certificates_from_workers = 45;
// query the state about how many requests of each type has been received
// since startup
CountRequests count_requests = 46;
// patch a running HTTP listener in place (no socket re-bind)
UpdateHttpListenerConfig update_http_listener = 47;
// patch a running HTTPS listener in place (no socket re-bind)
UpdateHttpsListenerConfig update_https_listener = 48;
// patch a running TCP listener in place (no socket re-bind)
UpdateTcpListenerConfig update_tcp_listener = 49;
// set the global per-(cluster, source-IP) connection limit at
// runtime. `0` is "unlimited". Per-cluster overrides set on the
// `Cluster` message take precedence at admit time.
uint64 set_max_connections_per_ip = 50;
// query the current global per-(cluster, source-IP) connection
// limit. Workers reply with `MaxConnectionsPerIpLimit`.
QueryMaxConnectionsPerIp query_max_connections_per_ip = 51;
// set or update the health check configuration for a cluster.
// Tags 47-49 carry in-place listener patches (HTTP/HTTPS/TCP) and
// 50-51 carry the per-(cluster, source-IP) connection-limit
// request/query, so health-check verbs start at 52.
SetHealthCheck set_health_check = 52;
// remove the health check configuration from a cluster.
string remove_health_check = 53;
// list health check configurations (optional cluster id filter).
QueryHealthChecks query_health_checks = 54;
// Apply, renew, or release a runtime cardinality lease on the metrics
// drain. `sozu top` (and any future TUI client) leases DETAIL_BACKEND
// for the duration of an interactive session; the worker's effective
// detail is `max(configured, max(active leases))`. Leases self-expire
// server-side after `ttl_seconds` so a crashed client never permanently
// elevates cardinality. See doc/configure.md for the full semantics.
SetMetricDetail set_metric_detail = 55;
// add a UDP listener
UdpListenerConfig add_udp_listener = 56;
// patch a running UDP listener in place (no socket re-bind)
UpdateUdpListenerConfig update_udp_listener = 57;
// add a UDP frontend
RequestUdpFrontend add_udp_frontend = 58;
// remove a UDP frontend
RequestUdpFrontend remove_udp_frontend = 59;
// set the global per-(cluster, source-SUBNET) connection limit at
// runtime. `0` is "unlimited" and is the default, which is why the
// subnet limiter is inert until an operator turns it on. This is a
// SECOND, independent counter: it does not replace, relax or
// tighten `set_max_connections_per_ip`, and both gates must admit a
// connection for it to proceed. Per-cluster overrides set on the
// `Cluster` message take precedence at admit time. The prefix
// lengths themselves are boot-time only (`ServerConfig`), because
// changing a mask would re-key every live counter.
uint64 set_max_connections_per_subnet = 60;
// query the current global per-(cluster, source-SUBNET) connection
// limit AND the two prefix lengths in force. Workers reply with
// `MaxConnectionsPerSubnetLimit`.
QueryMaxConnectionsPerSubnet query_max_connections_per_subnet = 61;
// set the global backend connection attempt budget of every request
// at runtime: how many backend connections a request may try, the
// first included, before it is answered `503`. Between 1 and 255.
// A cluster's own `Cluster.max_connection_attempts` takes precedence.
// Not persisted: a worker started later reads `ServerConfig`.
uint32 set_max_connection_attempts = 62;
// add an HTTPS listener that authenticates clients with a certificate
// (`client_auth` set to anything other than CLIENT_AUTH_NONE).
//
// Same payload as `add_https_listener`, distinct verb on purpose. A
// worker or main process that predates mutual TLS decodes
// `add_https_listener` but skips the unknown `client_auth` /
// `client_ca_*` tags, so it would build the listener without client
// authentication and acknowledge it. It cannot decode this verb at all,
// so it never builds the listener: the request fails instead of
// degrading to unauthenticated access. This matters while the fleet is
// mixed, between `UpgradeMain` and the replacement of every worker.
//
// Emitters pick the verb from the config with
// `RequestType::add_https_listener`, and the main process rewrites every
// request it fans out to workers to that canonical verb, so an
// `add_https_listener` that carries client authentication never reaches
// a worker. A listener without client authentication keeps
// `add_https_listener`, which every worker version understands.
HttpsListenerConfig add_https_listener_with_client_auth = 63;
// patch a running HTTPS listener whose patch replaces its client
// authentication policy (`UpdateHttpsListenerConfig.client_auth_policy`
// set). Same payload as `update_https_listener`, distinct verb for the
// reason given on `add_https_listener_with_client_auth`: a worker that
// predates this field would skip it and acknowledge the patch, keeping
// the CA and CRLs it had, so a revocation the new CRL adds would never
// apply there. It cannot decode this verb, so the patch fails instead.
// `RequestType::into_canonical` picks the verb, and the main process
// applies it to every request it fans out to workers.
UpdateHttpsListenerConfig update_https_listener_with_client_auth = 64;
// close the HTTP, HTTPS, TCP and WebSocket sessions of a cluster, or of
// one backend of a cluster, on every worker. An action, never saved in
// the state nor replayed by `load_state` or an upgrade. Workers reply
// with `ClosedSessions`, which the main process gathers per worker in
// `WorkerResponses`. See `doc/configure_cli.md` for the close semantics.
CloseSessions close_sessions = 65;
// add, or remove, an HTTP or HTTPS frontend that carries header
// predicates (`RequestHttpFrontend.header_predicates` non-empty).
//
// Same payload as `add_http_frontend` & co, distinct verbs on purpose
// (sozu-proxy/sozu#1253). A worker that predates header routing decodes
// `add_http_frontend` but skips the unknown `header_predicates` tag, so
// it would install the frontend WITHOUT its guard and send every request
// for the host to the predicated cluster; a removal would take away the
// unpredicated sibling that shares the rest of the key. It cannot decode
// these verbs at all, so the request fails instead. Emitters pick the
// verb with `RequestType::add_http_frontend` & co, and the main process
// rewrites every request it fans out to workers with
// `RequestType::into_canonical`. A frontend without predicates keeps the
// historical verbs, which every worker version understands.
//
// Tags 65 (`close_sessions`), 70-71 (silent-close add HTTP/HTTPS) and 72
// (`add_unix_backend`) are allocated to other verbs: do not reuse them.
RequestHttpFrontend add_http_frontend_with_header_predicates = 66;
RequestHttpFrontend remove_http_frontend_with_header_predicates = 67;
RequestHttpFrontend add_https_frontend_with_header_predicates = 68;
RequestHttpFrontend remove_https_frontend_with_header_predicates = 69;
// add an HTTP frontend whose `redirect` is `SILENT_CLOSE`. Same payload as
// `add_http_frontend`, distinct verb for the reason given on
// `add_https_listener_with_client_auth`: a worker that predates
// `SILENT_CLOSE` decodes the unknown enum value, resolves it to
// `FORWARD` and installs a route that forwards the traffic the operator
// asked to drop. It cannot decode this verb, so the request fails.
// `RequestType::add_http_frontend` / `RequestType::into_canonical` pick
// the verb, and the main process applies it to every request it fans out.
RequestHttpFrontend add_http_frontend_with_silent_close = 70;
// add an HTTPS frontend whose `redirect` is `SILENT_CLOSE`. See
// `add_http_frontend_with_silent_close`.
RequestHttpFrontend add_https_frontend_with_silent_close = 71;
// add a backend that sozu dials over a UNIX domain stream socket
// (`AddBackend.unix_path` set), with the same payload and the same
// semantics as `add_backend`, distinct verb on purpose. A worker or main
// process that predates UNIX backends decodes `add_backend` but skips the
// unknown `unix_path` tag, so it would register the backend and dial its
// identity `address` over TCP: traffic meant for a local socket reaching
// whatever listens on that address, or nothing. It cannot decode this
// verb at all (it sees no known request), so it never registers the
// backend and never degrades it to an IP endpoint; it sends no response
// for it. This matters while the fleet is mixed, between `UpgradeMain`
// and the replacement of every worker.
//
// Emitters pick the verb with `RequestType::add_backend`, and the main
// process rewrites every request it fans out to workers to that canonical
// verb, so an `add_backend` that carries a `unix_path` never reaches a
// worker. A backend without `unix_path` keeps `add_backend`, which every
// worker version understands.
//
// Tags 65-71 are taken by other verbs (close sessions, header routing,
// silent frontend close): 72 is this verb's, and must not be renumbered.
AddBackend add_unix_backend = 72;
// Protected variant of `set_health_check`: the same order plus the clear
// bytes of the custom header values, which no other verb may carry. It is
// a distinct verb, not a field of `SetHealthCheck`, so that a main process
// which predates it decodes no verb at all and refuses the request instead
// of configuring a probe without its credentials and answering success.
//
// Tags 65-72 are taken by other verbs: 73 is this verb's.
SetProtectedHealthCheck set_protected_health_check = 73;
// Internal main-to-worker verbs of the all-worker acknowledged protected
// health check path. A client never sends them: the main process refuses
// them on the command socket. A worker that predates them decodes no verb
// and never answers with `protected_health_check_reply`, which is how the
// main process learns it must not be sent a value.
//
// Tags 65-73 are taken by other verbs: 74 and 75 are these verbs'.
QueryProtectedHealthCheckSupport query_protected_health_check_support = 74;
ProtectedHealthCheckOrder protected_health_check_order = 75;
// Internal worker upgrade transaction. A legacy worker sees no request
// and keeps listening. The legacy ReturnListenSockets verb remains separate.
ListenerHandoff listener_handoff = 76;
}
}
// Selects the sessions `Request.close_sessions` closes: those with a backend
// connection to `cluster_id`, narrowed to one backend when `backend_id`, or
// `address`, or both are set (a backend matches only if every set field
// matches).
message CloseSessions {
required string cluster_id = 1;
optional string backend_id = 2;
optional SocketAddress address = 3;
}
message QueryHealthChecks {
optional string cluster_id = 1;
}
message SetHealthCheck {
required string cluster_id = 1;
required HealthCheckConfig config = 2;
}
// Sets the health check of a cluster together with the clear values of its
// custom headers. As received from an operator `config.headers` names the
// headers in order and carries no fingerprint; `values` holds one carrier per
// header, in the same order. The main process validates all of it, recomputes
// every fingerprint with its own key and forwards the same verb to the workers
// with the trusted fingerprints in place. Never persisted, never serialized to
// JSON: the carriers refuse serde.
message SetProtectedHealthCheck {
required string cluster_id = 1;
required HealthCheckConfig config = 2;
repeated HealthCheckHeaderValue values = 3;
}
// Asks a worker whether it implements the protected health check protocol.
// Carries nothing: no cluster, no value.
message QueryProtectedHealthCheckSupport {}
// Where a protected health check change stands for one worker.
enum ProtectedHealthCheckPhase {
// Positive answer to `QueryProtectedHealthCheckSupport`.
PROTECTED_HEALTH_CHECK_CAPABILITY = 0;
// Validate and stage `prepare` without applying it.
PROTECTED_HEALTH_CHECK_PREPARE = 1;
// Apply the staged `version`, configuration and values together.
PROTECTED_HEALTH_CHECK_COMMIT = 2;
// Drop the staged `version`, or restore the state that preceded it.
PROTECTED_HEALTH_CHECK_ABORT = 3;
// The change succeeded everywhere: forget the state that preceded it.
PROTECTED_HEALTH_CHECK_RELEASE = 4;
}
// One internal order of the protected health check protocol. Only `PREPARE`
// carries `prepare`, which holds the clear header values: it is the single
// main-to-worker carrier of them, and lives in the channel buffers only.
message ProtectedHealthCheckOrder {
required ProtectedHealthCheckPhase phase = 1;
required string cluster_id = 2;
required uint64 version = 3;
optional SetProtectedHealthCheck prepare = 4;
}
// A worker's positive answer to a protected health check order: its phase,
// the cluster and the version it acted on, never a header name or value.
message ProtectedHealthCheckReply {
required ProtectedHealthCheckPhase phase = 1;
required string cluster_id = 2;
required uint64 version = 3;
}
message ListWorkers {}
message ListListeners {}
message UpgradeMain {}
message SubscribeEvents {}
message Status {}
message QueryClustersHashes {}
message SoftStop {}
message HardStop {}
message ReturnListenSockets {}
message ListenerHandoff {
required string transfer_id = 1;
// A batch index sends one SCM frame. After the last batch, the next
// index sends an empty frame. Omitting both action fields commits.
optional uint32 batch = 2;
// Both forms snapshot live sockets without sending a frame. True keeps
// the historical detach-on-commit behavior. False opts in to a reversible
// ingress pause. Older batching workers reject false before any transfer.
optional bool prepare = 3;
// With prepare=false, reopen ingress for this transfer. The old worker
// uses this to roll back and the replacement uses it to start serving.
optional bool resume = 4;
}
message CountRequests {}
message QueryMaxConnectionsPerIp {}
message QueryMaxConnectionsPerSubnet {}
// Wrapper message to distinguish "absent" (preserve) from "present but empty"
// (reset to default) for ALPN protocols. A bare `repeated string` cannot make
// this distinction in proto2 since field absence is not detectable for repeated
// scalars without a sentinel.
message AlpnProtocols {
repeated string values = 1;
}
// Partial-update patch for a running HTTP listener.
// Only fields that are `Some` in the patch will be applied;
// absent fields preserve their current value on the listener.
// Bind-only fields (address, interface, active) are intentionally absent — use
// RemoveListener + AddHttpListener to change them.
// `interface` is bind-only too, and not even a selector here: `address`
// names the listener, and the main process refuses the patch when several
// listeners share that address on different interfaces.
message UpdateHttpListenerConfig {
// identifies the listener to patch (required — used as key)
required SocketAddress address = 1;
optional SocketAddress public_address = 2;
optional bool expect_proxy = 3;
optional string sticky_name = 4;
// client inactive time, in seconds
optional uint32 front_timeout = 5;
// backend server inactive time, in seconds
optional uint32 back_timeout = 6;
// time to connect to the backend, in seconds
optional uint32 connect_timeout = 7;
// max time to send a complete request, in seconds
optional uint32 request_timeout = 8;
// DEPRECATED: per-status answer message. Prefer the `answers` map at
// field 38. Kept on the wire so older managers can still patch a running
// listener for one minor; on the worker side both fields are merged.
optional CustomHttpAnswers http_answers = 9;
// H2 flood thresholds — see HttpListenerConfig for semantics & CVE refs.
// All values must be >= 1 (validated server-side before applying).
// Maximum RST_STREAM frames per second window (CVE-2023-44487, CVE-2019-9514)
optional uint32 h2_max_rst_stream_per_window = 20;
// Maximum PING frames per second window (CVE-2019-9512)
optional uint32 h2_max_ping_per_window = 21;
// Maximum SETTINGS frames per second window (CVE-2019-9515)
optional uint32 h2_max_settings_per_window = 22;
// Maximum empty DATA frames per second window (CVE-2019-9518)
optional uint32 h2_max_empty_data_per_window = 23;
// Maximum CONTINUATION frames per header block (CVE-2024-27316)
optional uint32 h2_max_continuation_frames = 24;
// Maximum accumulated protocol anomalies before ENHANCE_YOUR_CALM
optional uint32 h2_max_glitch_count = 25;
// Connection-level receive window size in bytes (RFC 9113 §6.9.2)
optional uint32 h2_initial_connection_window = 26;
// Maximum concurrent H2 streams (SETTINGS_MAX_CONCURRENT_STREAMS); >= 1
optional uint32 h2_max_concurrent_streams = 27;
// Shrink threshold ratio for recycled stream slots; >= 2
optional uint32 h2_stream_shrink_ratio = 28;
// Floor of the lifetime cap on RST_STREAM frames received (CVE-2023-44487)
optional uint64 h2_max_rst_stream_lifetime = 29;
// Floor of the cap on pre-response RST_STREAM frames — Rapid Reset signature
optional uint64 h2_max_rst_stream_abusive_lifetime = 30;
// Floor of the cap on peer-provoked RST_STREAM frames the server emits (CVE-2025-8671)
optional uint64 h2_max_rst_stream_emitted_lifetime = 31;
// Maximum HPACK-decoded header list size per request (RFC 9113 §6.5.2)
optional uint32 h2_max_header_list_size = 32;
// Maximum HPACK dynamic table size accepted from the peer
optional uint32 h2_max_header_table_size = 33;
// Per-stream idle timeout in seconds
optional uint32 h2_stream_idle_timeout_seconds = 34;
// Maximum wall-clock seconds to wait after GOAWAY(NO_ERROR). 0 = wait forever.
optional uint32 h2_graceful_shutdown_deadline_seconds = 35;
// Maximum unsolicited connection-level (stream 0) WINDOW_UPDATE frames per window; >= 1
optional uint32 h2_max_window_update_stream0_per_window = 36;
// Name of the correlation header injected per request (e.g. "Sozu-Id")
optional string sozu_id_header = 37;
// Per-status HTTP answer template bodies, keyed by HTTP status code
// (e.g. "503"). Replaces the per-field shape of `CustomHttpAnswers` (field
// 9). An entry with an empty value is treated as "preserve current"; an
// entry with a non-empty value replaces the listener's stored template
// for that status. To clear a status template, recreate the listener.
map<string, string> answers = 38;
// When true, any client-supplied `X-Real-IP` header is stripped from
// requests before forwarding (anti-spoofing). See HttpListenerConfig.
optional bool elide_x_real_ip = 39;
// When true, a proxy-generated `X-Real-IP` header carrying the connection
// peer IP is appended to every forwarded request. See HttpListenerConfig.
optional bool send_x_real_ip = 40;
// Maximum materialized header fields per request — see HttpListenerConfig.
optional uint32 h2_max_header_fields = 41;
// Which forwarding header family the listener emits — see
// HttpListenerConfig.
optional ForwardedHeaders forwarded_headers = 42;
// Soft stream-refusal share of the pre-response RST_STREAM cap, in percent —
// see HttpListenerConfig.
optional uint32 h2_stream_refusal_percent = 43;
// Serve cleartext HTTP/2 to clients that open with the connection preface
// (prior knowledge) — see HttpListenerConfig. Affects new connections only.
optional bool h2c_prior_knowledge = 44;
}
// Partial-update patch for a running HTTPS listener.
// Only fields that are `Some` in the patch will be applied;
// absent fields preserve their current value on the listener.
// Bind-only fields (tls_versions, cipher_list, cipher_suites,
// signature_algorithms, groups_list, certificate, certificate_chain, key,
// send_tls13_tickets, interface, active) are intentionally absent — use
// RemoveListener + AddHttpsListener to change them.
// `interface` is bind-only too, and not even a selector here: `address`
// names the listener, and the main process refuses the patch when several
// listeners share that address on different interfaces.
message UpdateHttpsListenerConfig {
// identifies the listener to patch (required — used as key)
required SocketAddress address = 1;
optional SocketAddress public_address = 2;
optional bool expect_proxy = 3;
optional string sticky_name = 4;
// client inactive time, in seconds
optional uint32 front_timeout = 5;
// backend server inactive time, in seconds
optional uint32 back_timeout = 6;
// time to connect to the backend, in seconds
optional uint32 connect_timeout = 7;
// max time to send a complete request, in seconds
optional uint32 request_timeout = 8;
// DEPRECATED: per-status answer message. Prefer the `answers` map at
// field 38. Kept on the wire so older managers can still patch a running
// listener for one minor; on the worker side both fields are merged.
optional CustomHttpAnswers http_answers = 9;
// ALPN protocols to advertise during TLS handshake.
// Uses a wrapper message so "absent" (preserve) and "present but empty"
// (reset to default ["h2","http/1.1"]) are unambiguous. Valid values per
// element: "h2", "http/1.1". Validated server-side.
optional AlpnProtocols alpn_protocols = 10;
// When true, :authority/Host must match the TLS SNI (CWE-346/CWE-444)
optional bool strict_sni_binding = 11;
// When true, only H2 connections are accepted; HTTP/1.1 is dropped at handshake
optional bool disable_http11 = 12;
// H2 flood thresholds — same numbers/semantics as UpdateHttpListenerConfig.
// All values must be >= 1 (validated server-side before applying).
// Maximum RST_STREAM frames per second window (CVE-2023-44487, CVE-2019-9514)
optional uint32 h2_max_rst_stream_per_window = 20;
// Maximum PING frames per second window (CVE-2019-9512)
optional uint32 h2_max_ping_per_window = 21;
// Maximum SETTINGS frames per second window (CVE-2019-9515)
optional uint32 h2_max_settings_per_window = 22;
// Maximum empty DATA frames per second window (CVE-2019-9518)
optional uint32 h2_max_empty_data_per_window = 23;
// Maximum CONTINUATION frames per header block (CVE-2024-27316)
optional uint32 h2_max_continuation_frames = 24;
// Maximum accumulated protocol anomalies before ENHANCE_YOUR_CALM
optional uint32 h2_max_glitch_count = 25;
// Connection-level receive window size in bytes (RFC 9113 §6.9.2)
optional uint32 h2_initial_connection_window = 26;
// Maximum concurrent H2 streams (SETTINGS_MAX_CONCURRENT_STREAMS); >= 1
optional uint32 h2_max_concurrent_streams = 27;
// Shrink threshold ratio for recycled stream slots; >= 2
optional uint32 h2_stream_shrink_ratio = 28;
// Floor of the lifetime cap on RST_STREAM frames received (CVE-2023-44487)
optional uint64 h2_max_rst_stream_lifetime = 29;
// Floor of the cap on pre-response RST_STREAM frames — Rapid Reset signature
optional uint64 h2_max_rst_stream_abusive_lifetime = 30;
// Floor of the cap on peer-provoked RST_STREAM frames the server emits (CVE-2025-8671)
optional uint64 h2_max_rst_stream_emitted_lifetime = 31;
// Maximum HPACK-decoded header list size per request (RFC 9113 §6.5.2)
optional uint32 h2_max_header_list_size = 32;
// Maximum HPACK dynamic table size accepted from the peer
optional uint32 h2_max_header_table_size = 33;
// Per-stream idle timeout in seconds
optional uint32 h2_stream_idle_timeout_seconds = 34;
// Maximum wall-clock seconds to wait after GOAWAY(NO_ERROR). 0 = wait forever.
optional uint32 h2_graceful_shutdown_deadline_seconds = 35;
// Maximum unsolicited connection-level (stream 0) WINDOW_UPDATE frames per window; >= 1
optional uint32 h2_max_window_update_stream0_per_window = 36;
// Name of the correlation header injected per request (e.g. "Sozu-Id")
optional string sozu_id_header = 37;
// Per-status HTTP answer template bodies, keyed by HTTP status code
// (e.g. "503"). Replaces the per-field shape of `CustomHttpAnswers` (field
// 9). An entry with an empty value is treated as "preserve current"; an
// entry with a non-empty value replaces the listener's stored template
// for that status. To clear a status template, recreate the listener.
map<string, string> answers = 38;
// When true, any client-supplied `X-Real-IP` header is stripped from
// requests before forwarding (anti-spoofing). See HttpsListenerConfig.
optional bool elide_x_real_ip = 39;
// When true, a proxy-generated `X-Real-IP` header carrying the connection
// peer IP is appended to every forwarded request. See HttpsListenerConfig.
optional bool send_x_real_ip = 40;
// Listener-default HSTS policy (RFC 6797). Full-object replacement on
// partial update — when this field is `Some`, the supplied
// `HstsConfig` overwrites whatever the listener currently holds; when
// absent, the existing policy is preserved. Use
// `Some(HstsConfig { enabled: Some(false), .. })` to explicitly
// disable HSTS via partial update. Cites RFC 6797 §6.1 (single
// header) and §7.2 (HTTPS-only).
optional HstsConfig hsts = 41;
// Maximum materialized header fields per request — see HttpsListenerConfig.
optional uint32 h2_max_header_fields = 42;
// Which forwarding header family the listener emits — see
// HttpsListenerConfig.
optional ForwardedHeaders forwarded_headers = 43;
// Soft stream-refusal share of the pre-response RST_STREAM cap, in percent —
// see HttpsListenerConfig.
optional uint32 h2_stream_refusal_percent = 44;
// Client authentication policy. Full replacement: when set, the mode, the
// trusted CAs and the CRLs all take the values given here, so a CA or CRL
// left out is dropped, not kept; when absent, the policy is unchanged.
// This is how a CRL or CA bundle is refreshed without recreating the
// listener. Only new handshakes see the new policy.
optional ClientAuthPolicy client_auth_policy = 45;
}
// The client authentication policy of an HTTPS listener, as carried by an
// `UpdateHttpsListenerConfig` patch. Same meaning as the `client_auth`,
// `client_ca_certificates` and `client_ca_crls` fields of
// `HttpsListenerConfig`.
message ClientAuthPolicy {
optional ClientAuthMode client_auth = 1;
repeated string client_ca_certificates = 2;
repeated string client_ca_crls = 3;
}
// Partial-update patch for a running TCP listener.
// Only fields that are `Some` in the patch will be applied;
// absent fields preserve their current value on the listener.
// Bind-only fields (address, interface, active) are intentionally absent.
// `interface` is bind-only too, and not even a selector here: `address`
// names the listener, and the main process refuses the patch when several
// listeners share that address on different interfaces.
message UpdateTcpListenerConfig {
// identifies the listener to patch (required — used as key)
required SocketAddress address = 1;
optional SocketAddress public_address = 2;
optional bool expect_proxy = 3;
// client inactive time, in seconds
optional uint32 front_timeout = 4;
// backend server inactive time, in seconds
optional uint32 back_timeout = 5;
// time to connect to the backend, in seconds
optional uint32 connect_timeout = 6;
}
// Partial-update patch for a running UDP listener.
// Only fields that are `Some` in the patch will be applied;
// absent fields preserve their current value on the listener.
// Bind-only fields (address, interface, active) are intentionally absent — use
// RemoveListener + AddUdpListener to change them.
// `interface` is bind-only too, and not even a selector here: `address`
// names the listener, and the main process refuses the patch when several
// listeners share that address on different interfaces.
message UpdateUdpListenerConfig {
// identifies the listener to patch (required — used as key)
required SocketAddress address = 1;
optional SocketAddress public_address = 2;
// client flow idle time, in seconds
optional uint32 front_timeout = 3;
// upstream flow idle time, in seconds
optional uint32 back_timeout = 4;
// maximum received datagram size, in bytes (capped at buffer_size at runtime)
optional uint32 max_rx_datagram_size = 5;
// maximum number of concurrent flows; 0 = auto (~70% soft RLIMIT_NOFILE)
optional uint32 max_flows = 6;
}
// details of an HTTP listener
message HttpListenerConfig {
required SocketAddress address = 1;
optional SocketAddress public_address = 2;
required bool expect_proxy = 5 [default = false];
required string sticky_name = 6;
// client inactive time, in seconds
required uint32 front_timeout = 7 [default = 60];
// backend server inactive time, in seconds
required uint32 back_timeout = 8 [default = 30];
// time to connect to the backend, in seconds
required uint32 connect_timeout = 9 [default = 3];
// max time to send a complete request, in seconds
required uint32 request_timeout = 10 [default = 10];
// wether the listener is actively listening on its socket
required bool active = 11 [default = false];
// DEPRECATED: per-status answer message. Prefer the `answers` map at
// field 31. Kept on the wire so legacy state files round-trip cleanly;
// workers populate both fields and treat them as equivalent on read.
optional CustomHttpAnswers http_answers = 12;
// H2 flood detection thresholds (CVE mitigations).
// All are optional; when absent, built-in defaults are used.
// Maximum RST_STREAM frames per second window (CVE-2023-44487, CVE-2019-9514)
optional uint32 h2_max_rst_stream_per_window = 13;
// Maximum PING frames per second window (CVE-2019-9512)
optional uint32 h2_max_ping_per_window = 14;
// Maximum SETTINGS frames per second window (CVE-2019-9515)
optional uint32 h2_max_settings_per_window = 15;
// Maximum empty DATA frames per second window (CVE-2019-9518)
optional uint32 h2_max_empty_data_per_window = 16;
// Maximum CONTINUATION frames per header block (CVE-2024-27316)
optional uint32 h2_max_continuation_frames = 17;
// Maximum accumulated protocol anomalies before ENHANCE_YOUR_CALM
optional uint32 h2_max_glitch_count = 18;
// H2 connection tuning parameters.
// Connection-level receive window size in bytes (RFC 9113 §6.9.2).
// Default: 16777216 (16 MiB). Credit is returned per half window received.
optional uint32 h2_initial_connection_window = 19;
// Maximum concurrent H2 streams the proxy accepts (SETTINGS_MAX_CONCURRENT_STREAMS).
// Default: 100.
optional uint32 h2_max_concurrent_streams = 20;
// Shrink threshold ratio for recycled stream slots. Vec is shrunk when
// total_slots > active_streams * ratio. Default: 2.
optional uint32 h2_stream_shrink_ratio = 21;
// Floor of the connection-lifetime cap on RST_STREAM frames received
// (CVE-2023-44487): trips once the count exceeds this value and the
// resets received after a response started or on a closed stream exceed
// the streams a backend answered on the connection. Default: 200000.
optional uint64 h2_max_rst_stream_lifetime = 22;
// Floor of the cap on "abusive" (pre-response-start) RST_STREAM frames
// received on a frontend H2 connection — the Rapid Reset signature: trips
// once the count exceeds this value and more than half of the
// backend-routed streams were reset before their response.
// Default: 1000.
optional uint64 h2_max_rst_stream_abusive_lifetime = 23;
// Floor of the cap on RST_STREAM frames **emitted by the server** that
// the peer provoked (CVE-2025-8671 "MadeYouReset"): trips once the count
// exceeds this value and more than half of the
// backend-routed streams were reset before their response. Covers the
// emission-direction-flipped sibling of Rapid Reset, where an attacker
// sends legitimate-looking frames (Content-Length mismatch, header parse
// error, rejected priority, zero-increment WINDOW_UPDATE on an open
// stream) that coerce the server into emitting RST_STREAM. Resets Sōzu
// decides on its own (idle CANCEL, REFUSED_STREAM, STREAM_CLOSED,
// backend-failure INTERNAL_ERROR) and `NoError` resets are not counted.
// Default: 10000.
optional uint64 h2_max_rst_stream_emitted_lifetime = 27;
// Maximum accumulated HPACK-decoded header list size per request
// (SETTINGS_MAX_HEADER_LIST_SIZE, RFC 9113 §6.5.2). Default: 65536.
optional uint32 h2_max_header_list_size = 24;
// Per-stream idle timeout, in seconds. An open H2 stream that receives
// no meaningful application data (non-empty DATA or HEADERS frames) for
// this duration is cancelled (RST_STREAM / CANCEL). Active uploads that
// trickle DATA frames reset the timer on each non-empty frame. Defends
// against slow-multiplex Slowloris where a client keeps connection-level
// activity high (any frame resets the connection idle timer) while pinning
// up to `h2_max_concurrent_streams` streams. Unset, it inherits
// `back_timeout`, floored at 30 (so 30 with the default `back_timeout`);
// an explicit value wins, `0` meaning 1.
optional uint32 h2_stream_idle_timeout_seconds = 25;
// Maximum HPACK dynamic table size (SETTINGS_HEADER_TABLE_SIZE) accepted
// from the peer. Caps the peer-advertised value to prevent unbounded
// HPACK encoder memory growth. Default: 65536.
optional uint32 h2_max_header_table_size = 26;
// Maximum wall-clock seconds to wait for in-flight H2 streams after
// GOAWAY(NO_ERROR) before forcibly closing the connection. Default: 5.
// Set to 0 to require streams to finish (no forced close).
optional uint32 h2_graceful_shutdown_deadline_seconds = 28;
// Maximum unsolicited connection-level (stream 0) WINDOW_UPDATE frames
// per second window. Each DATA frame the proxy sends entitles the peer to
// two that are not counted; only the excess counts. Caps non-zero stream-0
// WINDOW_UPDATE floods that would otherwise stay under the generic glitch
// counter (zero-increment stream-0 updates already trigger GOAWAY per
// RFC 9113 §6.9). Default: 2000.
optional uint32 h2_max_window_update_stream0_per_window = 29;
// Name of the correlation header Sozu injects into every request and
// response to carry the per-request ULID. Default: "Sozu-Id". Operators
// who want to rebrand can set e.g. "X-Edge-Id" or "X-Request-Trace".
optional string sozu_id_header = 30;
// Per-status HTTP answer template bodies, keyed by HTTP status code
// (e.g. "404", "503"). Replaces the per-field shape of `CustomHttpAnswers`
// (field 12). The new field is populated alongside `http_answers` so
// legacy state files round-trip; new code should read this map.
map<string, string> answers = 31;
// When true, any client-supplied `X-Real-IP` header is stripped from
// requests before forwarding (anti-spoofing). Independently combinable
// with `send_x_real_ip`. Default: false.
optional bool elide_x_real_ip = 32 [default = false];
// When true, a proxy-generated `X-Real-IP` header carrying the connection
// peer IP (post-PROXY-v2 unwrap, i.e. the original client IP) is appended
// to every forwarded request. Independently combinable with
// `elide_x_real_ip`. Default: false.
optional bool send_x_real_ip = 33 [default = false];
// Maximum number of materialized header fields per request — HPACK fields
// plus expanded cookie crumbs (RFC 9113 §8.2.3). Bounds the HPACK
// indexed-reference header bomb, where 1-byte indexed references are
// amplified into per-entry bookkeeping. Default: 128.
optional uint32 h2_max_header_fields = 34;
// Name of the network interface (e.g. "wg0") the listening socket is
// bound to with SO_BINDTODEVICE, set before bind(). Linux only: the
// configuration loader refuses the key on any other platform. Part of the
// listener identity together with `address`, so two listeners may share an
// address on different interfaces. Absent = not bound to an interface (the
// historical behaviour). Not patchable: changing it needs a rebind, so it
// is absent from the Update*ListenerConfig patches.
optional string interface = 35;
// Which forwarding header family is added to every forwarded request:
// `X-Forwarded-*`, RFC 7239 `Forwarded`, both, or none. Independent of
// `elide_x_real_ip` and `send_x_real_ip`. Default: both.
optional ForwardedHeaders forwarded_headers = 36 [default = FORWARDED_HEADERS_BOTH];
// Share, in percent, of the pre-response RST_STREAM cap's floor
// (h2_max_rst_stream_abusive_lifetime) at which an H2 connection refuses
// new client streams with RST_STREAM(REFUSED_STREAM), retryable per
// RFC 9113 §8.7, and keeps serving its open streams. The cap itself still
// ends the connection with GOAWAY(ENHANCE_YOUR_CALM). 0 disables the soft
// state; 100 or more never engages it before the cap. Default: 50.
optional uint32 h2_stream_refusal_percent = 37;
// When true, a connection whose first 24 bytes are the HTTP/2 connection
// preface (`PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n`, RFC 9113 §3.3 "prior
// knowledge") is served as HTTP/2 over cleartext (h2c), exactly as an
// HTTPS connection that negotiated `h2` through ALPN; every other
// connection stays HTTP/1.x. The `Upgrade: h2c` mechanism is never
// supported. When false, a preface is rejected as a malformed HTTP/1.x
// request (400). Default: false.
optional bool h2c_prior_knowledge = 38 [default = false];
}
// details of an HTTPS listener
message HttpsListenerConfig {
required SocketAddress address = 1;
optional SocketAddress public_address = 2;
required bool expect_proxy = 5 [default = false];
required string sticky_name = 6;
// client inactive time, in seconds
required uint32 front_timeout = 7 [default = 60];
// backend server inactive time, in seconds
required uint32 back_timeout = 8 [default = 30];
// time to connect to the backend, in seconds
required uint32 connect_timeout = 9 [default = 3];
// max time to send a complete request, in seconds
required uint32 request_timeout = 10 [default = 10];
// wether the listener is actively listening on its socket
required bool active = 11 [default = false];
// TLS versions
repeated TlsVersion versions = 12;
repeated string cipher_list = 13;
repeated string cipher_suites = 14;
repeated string signature_algorithms = 15;
repeated string groups_list = 16;
optional string certificate = 17;
repeated string certificate_chain = 18;
optional string key = 19;
// Number of TLS 1.3 tickets to send to a client when establishing a connection.
// The tickets allow the client to resume a session. This protects the client
// agains session tracking. Defaults to 4.
required uint64 send_tls13_tickets = 20;
// DEPRECATED: per-status answer message. Prefer the `answers` map at
// field 43. Kept on the wire so legacy state files round-trip cleanly;
// workers populate both fields and treat them as equivalent on read.
optional CustomHttpAnswers http_answers = 21;
// ALPN protocols to advertise during TLS handshake, in order of preference.
// Valid values: "h2", "http/1.1". Defaults to ["h2", "http/1.1"].
repeated string alpn_protocols = 22;
// H2 flood detection thresholds (CVE mitigations).
// All are optional; when absent, built-in defaults are used.
// Maximum RST_STREAM frames per second window (CVE-2023-44487, CVE-2019-9514)
optional uint32 h2_max_rst_stream_per_window = 23;
// Maximum PING frames per second window (CVE-2019-9512)
optional uint32 h2_max_ping_per_window = 24;
// Maximum SETTINGS frames per second window (CVE-2019-9515)
optional uint32 h2_max_settings_per_window = 25;
// Maximum empty DATA frames per second window (CVE-2019-9518)
optional uint32 h2_max_empty_data_per_window = 26;
// Maximum CONTINUATION frames per header block (CVE-2024-27316)
optional uint32 h2_max_continuation_frames = 27;
// Maximum accumulated protocol anomalies before ENHANCE_YOUR_CALM
optional uint32 h2_max_glitch_count = 28;
// H2 connection tuning parameters.
// Connection-level receive window size in bytes (RFC 9113 §6.9.2).
// Default: 16777216 (16 MiB). Credit is returned per half window received.
optional uint32 h2_initial_connection_window = 29;
// Maximum concurrent H2 streams the proxy accepts (SETTINGS_MAX_CONCURRENT_STREAMS).
// Default: 100.
optional uint32 h2_max_concurrent_streams = 30;
// Shrink threshold ratio for recycled stream slots. Vec is shrunk when
// total_slots > active_streams * ratio. Default: 2.
optional uint32 h2_stream_shrink_ratio = 31;
// Floor of the connection-lifetime cap on RST_STREAM frames received
// (CVE-2023-44487): trips once the count exceeds this value and the
// resets received after a response started or on a closed stream exceed
// the streams a backend answered on the connection. Default: 200000.
optional uint64 h2_max_rst_stream_lifetime = 32;
// Floor of the cap on "abusive" (pre-response-start) RST_STREAM frames
// received on a frontend H2 connection — the Rapid Reset signature: trips
// once the count exceeds this value and more than half of the
// backend-routed streams were reset before their response.
// Default: 1000.
optional uint64 h2_max_rst_stream_abusive_lifetime = 33;
// Floor of the cap on RST_STREAM frames **emitted by the server** that
// the peer provoked (CVE-2025-8671 "MadeYouReset"): trips once the count
// exceeds this value and more than half of the
// backend-routed streams were reset before their response. Covers the
// emission-direction-flipped sibling of Rapid Reset, where an attacker
// sends legitimate-looking frames (Content-Length mismatch, header parse
// error, rejected priority, zero-increment WINDOW_UPDATE on an open
// stream) that coerce the server into emitting RST_STREAM. Resets Sōzu
// decides on its own (idle CANCEL, REFUSED_STREAM, STREAM_CLOSED,
// backend-failure INTERNAL_ERROR) and `NoError` resets are not counted.
// Default: 10000.
optional uint64 h2_max_rst_stream_emitted_lifetime = 39;
// Maximum accumulated HPACK-decoded header list size per request
// (SETTINGS_MAX_HEADER_LIST_SIZE, RFC 9113 §6.5.2). Default: 65536.
optional uint32 h2_max_header_list_size = 34;
// When true, every HTTP request served on this listener must have its
// `:authority` / `Host` host exact-match the TLS SNI that was negotiated
// at handshake (CWE-346 / CWE-444). Disabling this lifts the per-stream
// TLS trust boundary, so leave enabled unless an operational need
// requires cross-SNI routing. Default: true.
optional bool strict_sni_binding = 35;
// When true, this listener only accepts HTTP/2 connections: clients
// that fail to negotiate `h2` via TLS ALPN (including those that
// omit ALPN altogether) are dropped at handshake instead of silently
// falling back to HTTP/1.1. Default: false — preserves the historical
// "ALPN missing defaults to h1" behavior.
optional bool disable_http11 = 36;
// Per-stream idle timeout, in seconds. An open H2 stream that receives
// no meaningful application data (non-empty DATA or HEADERS frames) for
// this duration is cancelled (RST_STREAM / CANCEL). Active uploads that
// trickle DATA frames reset the timer on each non-empty frame. Defends
// against slow-multiplex Slowloris where a client keeps connection-level
// activity high (any frame resets the connection idle timer) while pinning
// up to `h2_max_concurrent_streams` streams. Unset, it inherits
// `back_timeout`, floored at 30 (so 30 with the default `back_timeout`);
// an explicit value wins, `0` meaning 1.
optional uint32 h2_stream_idle_timeout_seconds = 37;
// Maximum HPACK dynamic table size (SETTINGS_HEADER_TABLE_SIZE) accepted
// from the peer. Caps the peer-advertised value to prevent unbounded
// HPACK encoder memory growth. Default: 65536.
optional uint32 h2_max_header_table_size = 38;
// Maximum wall-clock seconds to wait for in-flight H2 streams after
// GOAWAY(NO_ERROR) before forcibly closing the connection. Default: 5.
// Set to 0 to require streams to finish (no forced close).
optional uint32 h2_graceful_shutdown_deadline_seconds = 40;
// Maximum unsolicited connection-level (stream 0) WINDOW_UPDATE frames
// per second window. Each DATA frame the proxy sends entitles the peer to
// two that are not counted; only the excess counts. Caps non-zero stream-0
// WINDOW_UPDATE floods that would otherwise stay under the generic glitch
// counter (zero-increment stream-0 updates already trigger GOAWAY per
// RFC 9113 §6.9). Default: 2000.
optional uint32 h2_max_window_update_stream0_per_window = 41;
// Name of the correlation header Sozu injects into every request and
// response to carry the per-request ULID. Default: "Sozu-Id". Operators
// who want to rebrand can set e.g. "X-Edge-Id" or "X-Request-Trace".
optional string sozu_id_header = 42;
// Per-status HTTP answer template bodies, keyed by HTTP status code
// (e.g. "404", "503"). Replaces the per-field shape of `CustomHttpAnswers`
// (field 21). The new field is populated alongside `http_answers` so
// legacy state files round-trip; new code should read this map.
map<string, string> answers = 43;
// When true, any client-supplied `X-Real-IP` header is stripped from
// requests before forwarding (anti-spoofing). Independently combinable
// with `send_x_real_ip`. Default: false.
optional bool elide_x_real_ip = 44 [default = false];
// When true, a proxy-generated `X-Real-IP` header carrying the connection
// peer IP (post-PROXY-v2 unwrap, i.e. the original client IP) is appended
// to every forwarded request. Independently combinable with
// `elide_x_real_ip`. Default: false.
optional bool send_x_real_ip = 45 [default = false];
// Listener-default HSTS (HTTP Strict Transport Security, RFC 6797)
// policy. When set, every successful response on this listener gains
// a `Strict-Transport-Security` header derived from the materialised
// policy (RFC 6797 §6.1 single-header requirement, §7.2 HTTPS-only
// emission, §8.1 host scope, §11.4 max-age=0 kill-switch). A
// per-frontend `RequestHttpFrontend.hsts` overrides this default.
optional HstsConfig hsts = 46;
// Maximum number of materialized header fields per request — HPACK fields
// plus expanded cookie crumbs (RFC 9113 §8.2.3). Bounds the HPACK
// indexed-reference header bomb, where 1-byte indexed references are
// amplified into per-entry bookkeeping. Default: 128.
optional uint32 h2_max_header_fields = 47;
// Name of the network interface (e.g. "wg0") the listening socket is
// bound to with SO_BINDTODEVICE, set before bind(). Linux only: the
// configuration loader refuses the key on any other platform. Part of the
// listener identity together with `address`, so two listeners may share an
// address on different interfaces. Absent = not bound to an interface (the
// historical behaviour). Not patchable: changing it needs a rebind, so it
// is absent from the Update*ListenerConfig patches.
optional string interface = 48;
// Which forwarding header family is added to every forwarded request:
// `X-Forwarded-*`, RFC 7239 `Forwarded`, both, or none. Independent of
// `elide_x_real_ip` and `send_x_real_ip`. Default: both.
optional ForwardedHeaders forwarded_headers = 49 [default = FORWARDED_HEADERS_BOTH];
// Share, in percent, of the pre-response RST_STREAM cap's floor
// (h2_max_rst_stream_abusive_lifetime) at which an H2 connection refuses
// new client streams with RST_STREAM(REFUSED_STREAM), retryable per
// RFC 9113 §8.7, and keeps serving its open streams. The cap itself still
// ends the connection with GOAWAY(ENHANCE_YOUR_CALM). 0 disables the soft
// state; 100 or more never engages it before the cap. Default: 50.
optional uint32 h2_stream_refusal_percent = 50;
// Mutual TLS (client certificate authentication) mode for this listener.
// Absent or CLIENT_AUTH_NONE (the field-0 default) keeps the current
// behavior: no CertificateRequest is sent and any client certificate is
// ignored. OPTIONAL requests a client certificate but still accepts
// connections that present none; REQUIRED aborts the handshake when the
// client does not present a certificate chaining to a trusted CA.
optional ClientAuthMode client_auth = 51;
// PEM-encoded trusted CA certificates a client certificate must chain to
// for OPTIONAL/REQUIRED modes. Ignored when client_auth is NONE. Multiple
// entries build a single root store; each entry may itself hold a
// concatenated PEM chain.
repeated string client_ca_certificates = 52;
// Optional PEM-encoded certificate revocation lists (CRLs). When present,
// a presented client certificate is rejected if it (or an intermediate)
// appears revoked. Ignored when client_auth is NONE.
repeated string client_ca_crls = 53;
}
// details of an TCP listener
message TcpListenerConfig {
required SocketAddress address = 1;
optional SocketAddress public_address = 2;
required bool expect_proxy = 3 [default = false];
// client inactive time, in seconds
required uint32 front_timeout = 4 [default = 60];
// backend server inactive time, in seconds
required uint32 back_timeout = 5 [default = 30];
// time to connect to the backend, in seconds
required uint32 connect_timeout = 6 [default = 3];
// wether the listener is actively listening on its socket
required bool active = 7 [default = false];