close

Bun

Symbol

WebSocket.close

close(code?: number, reason?: string): void

Closes the WebSocket connection

@param code

A numeric value indicating the status code

@param reason

A human-readable string explaining why the connection is closing