WebSocket request/response header dance. Feels like the loop is getting close to closed, but I want to refactor everything.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4692 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2023-12-24 17:43:33 +00:00
parent 196ab66e14
commit 1621f1753a
5 changed files with 90 additions and 13 deletions

View File

@ -342,7 +342,6 @@ function handleWebSocketRequest(request, response, client) {
function webSocketAcceptResponse(key) {
let kMagic = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
let kAlphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
return base64Encode(sha1Digest(key + kMagic));
}