Created
September 20, 2024 15:54
-
-
Save Tsugami/b4c5dbf3b4cf6185b1f6643d6734e84f to your computer and use it in GitHub Desktop.
Revisions
-
Tsugami created this gist
Sep 20, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Document</title> </head> <body> arroz <script src=/eventsource-polyfill.js></script> <script> const id = `44869422808`; const url = `https://xxx/auth/${id}/face-match/events`; const token = 'xxxx'; const authorization = `Bearer ${token}`; const source = new EventSourcePolyfill(url, { // withCredentials: true, headers: { Authorization: authorization, }, }); source.onmessage = function(event) { console.log(event); }; source.onerror = function(error) { console.error(error); }; </script> </body> </html>