Commit c04a6f0
committed
feat(server): add keepAliveInterval to standalone GET SSE stream
Adds an opt-in keepAliveInterval option to
WebStandardStreamableHTTPServerTransportOptions that sends periodic
SSE comments (`: keepalive`) on the standalone GET SSE stream.
Reverse proxies commonly close connections that are idle for 30-60s.
With no server-initiated messages, the GET SSE stream has no traffic
during quiet periods, causing silent disconnections. This option lets
operators send harmless SSE comments at a configurable cadence to
keep the connection alive.
The timer is cleared on close(), closeStandaloneSSEStream(), and on
stream cancellation. Disabled by default; no behavior change for
existing deployments.
Addresses upstream #28, #876.1 parent df4b6cc commit c04a6f0
File tree
3 files changed
+129
-0
lines changed- .changeset
- packages/server
- src/server
- test/server
3 files changed
+129
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
144 | 153 | | |
145 | 154 | | |
146 | 155 | | |
| |||
239 | 248 | | |
240 | 249 | | |
241 | 250 | | |
| 251 | + | |
| 252 | + | |
242 | 253 | | |
243 | 254 | | |
244 | 255 | | |
| |||
256 | 267 | | |
257 | 268 | | |
258 | 269 | | |
| 270 | + | |
259 | 271 | | |
260 | 272 | | |
261 | 273 | | |
| |||
446 | 458 | | |
447 | 459 | | |
448 | 460 | | |
| 461 | + | |
449 | 462 | | |
450 | 463 | | |
451 | 464 | | |
| |||
475 | 488 | | |
476 | 489 | | |
477 | 490 | | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
478 | 504 | | |
479 | 505 | | |
480 | 506 | | |
| |||
897 | 923 | | |
898 | 924 | | |
899 | 925 | | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
900 | 933 | | |
901 | 934 | | |
902 | 935 | | |
903 | 936 | | |
904 | 937 | | |
| 938 | + | |
905 | 939 | | |
906 | 940 | | |
907 | 941 | | |
| |||
934 | 968 | | |
935 | 969 | | |
936 | 970 | | |
| 971 | + | |
937 | 972 | | |
938 | 973 | | |
939 | 974 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
993 | 993 | | |
994 | 994 | | |
995 | 995 | | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
996 | 1085 | | |
0 commit comments