gyghhhhhhhh

This commit is contained in:
CoolElectronics 2024-02-09 23:38:32 -05:00
commit 86abdca21e
No known key found for this signature in database
GPG key ID: F63593D168636C50
23 changed files with 1464 additions and 0 deletions

18
src/webSocket.ts Normal file
View file

@ -0,0 +1,18 @@
/*
* WebSocket helpers
*/
const validChars =
"!#$%&'*+-.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ^_`abcdefghijklmnopqrstuvwxyz|~";
export function validProtocol(protocol: string): boolean {
for (let i = 0; i < protocol.length; i++) {
const char = protocol[i];
if (!validChars.includes(char)) {
return false;
}
}
return true;
}