Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/TurboWarp/cloud-server
/ functions
Functions
58 in github.com/TurboWarp/cloud-server
⨍
Functions
58
◇
Types & classes
10
↓ 29 callers
Method
has
* Determine whether this room has a variable of a given name. * @param {string} name The name of the variable
src/Room.js:157
↓ 24 callers
Method
create
* Create a new variable. * This method does not inform clients of the change. * @param {string} name The name of the variable * @param {strin
src/Room.js:103
↓ 13 callers
Method
getClients
* Get all connected clients. * @returns {Client[]} All connected clients.
src/Room.js:84
↓ 12 callers
Method
get
* Get a variable. * @param {string} name The name of the variable * @returns {Value} Variable value. * @throws Will throw if the variable doe
src/Room.js:145
↓ 12 callers
Method
log
* Log a message including some metadata about this client. * @param {string} message
src/Client.js:67
↓ 10 callers
Method
set
* Set an existing variable to a new value. * This method does not inform clients of the change. * @param {string} name The name of the variable
src/Room.js:120
↓ 8 callers
Method
addClient
* Add a new client. * @param {Client} client The client to add * @throws Will throw if client is already added, or there are too many clients co
src/Room.js:56
↓ 7 callers
Function
naughty
* Determine whether a given string of text is probably safe for most audiences. * Note that this is not foolproof. * @param {string} text The text t
src/naughty.js:65
↓ 6 callers
Method
close
* Close the connection to this client with a given error code and remove from connected room. * @param {number} code The error code to send
src/Client.js:107
↓ 6 callers
Method
delete
* Delete a variable. * @param {string} name The name of the variable * @throws Will throw if the variable does not exist.
src/Room.js:132
↓ 6 callers
Method
removeClient
* Remove a client. * @param {Client} client The client to remove * @throws Will throw if the client is not part of this room.
src/Room.js:71
↓ 6 callers
Method
send
* Send a message to the client. * @param {import('ws').Data} data The data to send.
src/Client.js:91
↓ 5 callers
Method
remove
* Remove a Room * @param {RoomID} id The ID of the Room * @throws Will throw if the room does not exist, or if the room has clients connected.
src/RoomList.js:87
↓ 3 callers
Method
error
* Log an error message including some metadata about this client. * @param {string} message
src/Client.js:83
↓ 3 callers
Method
getAllVariables
* Get a map of all variables. * @returns {Map<string, Value>} All variables, and their value.
src/Room.js:92
↓ 3 callers
Method
updateLogPrefix
* Update the log prefix of this client. * @private
src/Client.js:52
↓ 2 callers
Function
createSetMessage
* Create a "set" message to send to clients to set a variable. * @param {string} name The name of the variable. * @param {string|number} value The v
src/server.js:56
↓ 2 callers
Function
performSet
(variable, value)
src/server.js:172
↓ 2 callers
Method
setRoom
* Set the room that this client connects to and join it. * @param {Room} room * @throws Will throw if the client is already in a room.
src/Client.js:125
↓ 2 callers
Function
setVariable
(name, value)
doc/node-client.js:34
↓ 2 callers
Method
timedOut
* @param {string} reason Reason for time out, included in logs.
src/Client.js:156
↓ 1 callers
Method
destroy
* Delete this RoomList. * Stops the janitor timer, if it is started.
src/RoomList.js:131
↓ 1 callers
Method
get
* Get a Room * @param {RoomID} id * @returns {Room} * @throws Will throw if room does not exist
src/RoomList.js:51
↓ 1 callers
Function
getForwardedFor
* Extract the value of the x-forwarded-for header. * @param {import('http').IncomingHttpHeaders} headers The request headers. * @returns {?string} T
src/address.js:8
↓ 1 callers
Method
handleConnect
* Handle a connection from a client. * @param {Client} client The Client connecting.
src/ConnectionManager.js:53
↓ 1 callers
Method
handleDisconnect
* Handle a disconnection from a client. * @param {Client} client The Client disconnecting.
src/ConnectionManager.js:61
↓ 1 callers
Method
handlePong
* Handle a pong from a client. * @param {Client} client The WebSocket server the pong is from
src/ConnectionManager.js:69
↓ 1 callers
Method
has
* Whether a Room exists in this list * @param {RoomID} id * @returns {boolean} Whether the room exists
src/RoomList.js:41
↓ 1 callers
Function
isFilterList
* Return whether a file should be read as a filter list. * @param {string} fileName The name of the file.
src/naughty.js:42
↓ 1 callers
Function
isGenerated
* Determine if a username is randomly generated or not. * @param {string} username The username to test. * @returns {boolean} true if the username w
src/username.js:22
↓ 1 callers
Function
isValidMessage
* @param {unknown} data * @returns {boolean}
src/server.js:32
↓ 1 callers
Function
loadFilter
* Load a filter. * @param {string} name The name of the filter. * @param {string} contents The contents of the filter.
src/naughty.js:28
↓ 1 callers
Function
loadFilters
* Load all filters from the filters directory.
src/naughty.js:49
↓ 1 callers
Function
parseMessage
* Parse WebSocket message data. * @param {string} data Message data * @returns {object}
src/server.js:42
↓ 1 callers
Function
parseUsername
* Anonymize a generated username, or return it unmodified * @param {string} username The username * @returns {string} Anonymized username or origina
src/username.js:10
↓ 1 callers
Function
performCreate
(variable, value)
src/server.js:141
↓ 1 callers
Function
performDelete
(variable)
src/server.js:145
↓ 1 callers
Function
performHandshake
(roomId, username)
src/server.js:106
↓ 1 callers
Function
performRename
(oldName, newName)
src/server.js:155
↓ 1 callers
Method
ping
* Send a ping message to this Client.
src/Client.js:146
↓ 1 callers
Function
processMessage
(data)
src/server.js:199
↓ 1 callers
Function
sendToClient
(client, message)
src/server.js:74
↓ 1 callers
Method
setUsername
* Set the username of this client. * @param {string} username The new username
src/Client.js:138
↓ 1 callers
Method
start
* Start the ConnectionManager's periodic check.
src/ConnectionManager.js:76
↓ 1 callers
Method
startJanitor
* Begin the janitor timer.
src/RoomList.js:123
↓ 1 callers
Method
stop
* Stop the ConnectionManager from running.
src/ConnectionManager.js:86
Method
constructor
* @param {?import('ws')} ws The WebSocket connection * @param {?import('http').IncomingMessage} req The HTTP request
src/Client.js:11
Method
constructor
()
src/RoomList.js:17
Method
constructor
()
src/ConnectionManager.js:10
Method
constructor
* ConnectionError is an error with some special handling from the server. * @param {number} code WebSocket status code. * @param {string} messag
src/ConnectionError.js:7
Method
constructor
* @param {RoomID} id
src/Room.js:17
Method
create
* Create a new Room * @param {RoomID} id The room ID * @returns {Room} A new room * @throws Will throw if there are too many rooms.
src/RoomList.js:65
Function
getAddress
* Get the remote IP address of a request. * Follows config values set in config.js. * @param {?import('http').IncomingMessage} req The incoming HTTP
src/address.js:24
Function
getVariable
(name)
doc/node-client.js:44
Method
janitor
* Scan for dormant rooms and remove them. * @private
src/RoomList.js:102
Function
sendBuffered
()
src/server.js:65
Method
update
* @private
src/ConnectionManager.js:25
Method
warn
* Log a warning message including some metadata about this client. * @param {string} message
src/Client.js:75