> ## Documentation Index
> Fetch the complete documentation index at: https://docs.projectreal.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# WebSocket.Close

> Menutup WebSocket object yang dikembalikan oleh WebSocket.connect. Argument pertama harus berupa table. Fungsi membaca field connection state milik object; saat live state ada dan belum destroyed atau closed, fungsi mengatur isClosed ke true dan mengirim frame close frame kosong melalui WebSocket connection yang tersimpan. Fungsi tidak menerima close code atau reason dan tidak mengembalikan values.

<div className="real-function-page">
  ```lua theme={null}
  WebSocket.Close(socket: WebSocket)
  ```

  ## Argumen

  <ParamField path={"socket"} type={"WebSocket"} required>
    WebSocket table yang dikembalikan oleh WebSocket.connect. Function mengharapkan table ini berisi connection state.
  </ParamField>

  ## Contoh

  Close a WebSocket object returned by WebSocket.connect.

  ```lua theme={null}
  local socket = WebSocket.connect("wss://example.com/socket")

  socket:Close()
  ```
</div>
