You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// because EventSource cannot access headers, we are making a regular get request to SSE server to get its headers, and then passing those headers into function where we will be connecting our EventSource, there will a time delay between the time the user opens the request and the server sends back its first response. We keep reference to the time the first request was made to account for that time difference later on.
14
14
conststartTime=Date.now();
15
15
16
-
http.get(headers.url,{
16
+
constreq=http.get(headers.url,{
17
17
headers,
18
18
agent: false,
19
-
},(res)=>{
20
-
// update info in reqResObj to reflect fact that connection was succesful
21
-
reqResObj.response.headers={...res.headers};
22
-
reqResObj.connection='open';
23
-
reqResObj.connectionType='SSE';
24
-
// invoke function that will create an EventSource
0 commit comments