mirror of
https://github.com/MercuryWorkshop/bare-mux.git
synced 2025-05-16 23:50:01 -04:00
gyghhhhhhhh
This commit is contained in:
commit
86abdca21e
23 changed files with 1464 additions and 0 deletions
18
src/webSocket.ts
Normal file
18
src/webSocket.ts
Normal 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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue