> Agent-readable docs index: /llms.txt. Download /docs.zip to grep all markdown files locally.

---
title: WebSocket
icon: cable
---

# <ApiPageIcon icon="cable" />WebSocket

<ApiExposes data="[{&#x22;k&#x22;:&#x22;NAMESPACE&#x22;,&#x22;c&#x22;:&#x22;fn&#x22;,&#x22;s&#x22;:&#x22;websocket&#x22;,&#x22;h&#x22;:&#x22;#websocket-1&#x22;},{&#x22;k&#x22;:&#x22;OBJECT&#x22;,&#x22;c&#x22;:&#x22;method&#x22;,&#x22;s&#x22;:&#x22;websocket.Options&#x22;,&#x22;h&#x22;:&#x22;#websocketoptions&#x22;},{&#x22;k&#x22;:&#x22;OBJECT&#x22;,&#x22;c&#x22;:&#x22;method&#x22;,&#x22;s&#x22;:&#x22;websocket.Callbacks&#x22;,&#x22;h&#x22;:&#x22;#websocketcallbacks&#x22;},{&#x22;k&#x22;:&#x22;OBJECT&#x22;,&#x22;c&#x22;:&#x22;method&#x22;,&#x22;s&#x22;:&#x22;websocket.Socket&#x22;,&#x22;h&#x22;:&#x22;#websocketsocket&#x22;}]" />

<Heading level={2} id="websocket-1">
  websocket

  <ApiTag label="global table" />
</Heading>

Opens WebSocket connections. A connection stays open, and it passes what happens to the
callbacks that you give to `websocket.Connect`.

Add `websocket` to the `requirements` in `extension.json` before you call
`require("websocket")`.

You can leave out `options`. So `websocket.Connect(url, callbacks)` and
`websocket.Connect(url, options, callbacks)` both work. A value in the place of `options` that is
not a table, such as `false`, counts as no options.

Market scripts can connect only to `wss://` URLs on public addresses. Developer scripts can also
use `ws://` URLs and connect to the computer of the user or to a private network. For a `wss://`
URL, the certificate of the server must be valid for its host name.

Callbacks run only while the script is loaded. All scripts are reloaded together. So when
another script is turned on or off, or a developer script is saved, every open socket is closed
with code `1001`, and none of its callbacks run again. In that case the `shutdown` callback of
the script receives `"refresh"` or `"reload"`, and the script can connect again when it runs.

A socket stays open as long as the script is loaded, even if no variable holds its
`websocket.Socket` any more.

A script can have at most 16 sockets that are not closed. Past that, `websocket.Connect` throws
an error. A message can be at most 64 MB. At most 64 callbacks of one socket run in one frame,
and the rest run in the next frames. If 4096 messages or 64 MB of messages are waiting for the
script, the socket is closed with the `"overflow"` error.

A socket does not reconnect by itself, and it does not send pings to the server. To find a
connection that stopped working without a close, send a message on a timer and wait for a reply.

An option key or a callback key that is not listed below is ignored. In a developer script, an
unknown key also adds a warning to the errors of the script, once for each key.

<ApiMembers>
  <ApiMember kind="fn" name="websocket.Connect" summary="Starts to connect and returns at once. Everything that happens after that is passed to `callbacks`. This includes a failure to connect." args="url, options?, callbacks" sig="[{&#x22;s&#x22;:&#x22;websocket.Connect&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;url&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;[, &#x22;},{&#x22;s&#x22;:&#x22;options&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;websocket.Options&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/networking/websocket#websocketoptions&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;callbacks&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;websocket.Callbacks&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/networking/websocket#websocketcallbacks&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;websocket.Socket&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/networking/websocket#websocketsocket&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;websocket.Socket&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/networking/websocket#websocketsocket&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;url&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}],&#x22;d&#x22;:&#x22;The URL to connect to. It must start with `wss://`. Developer scripts can also use `ws://`.&#x22;},{&#x22;n&#x22;:&#x22;options&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;websocket.Options&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/networking/websocket#websocketoptions&#x22;}],&#x22;d&#x22;:&#x22;The options of the connection.&#x22;,&#x22;o&#x22;:true},{&#x22;n&#x22;:&#x22;callbacks&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;websocket.Callbacks&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/networking/websocket#websocketcallbacks&#x22;}],&#x22;d&#x22;:&#x22;The functions to call when something happens on the connection.&#x22;}]">
    <ApiNotes>
      Throws an error in these cases. A callback is not a function. A header name is not a string, or
      it is not a valid HTTP token. A header value contains CR, LF or NUL. A subprotocol is not a valid
      HTTP token. A header is `Host`, `Upgrade`, `Connection` or starts with `Sec-WebSocket-`. The
      handshake sets these headers itself.
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="type" name="websocket.Error" summary="The reason why a connection failed or was lost." ret="[[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}]]" expand="[{&#x22;n&#x22;:&#x22;&#x22;,&#x22;values&#x22;:[[&#x22;\&#x22;blocked\&#x22;&#x22;,&#x22;&#x22;,&#x22;The address is on the computer of the user or on a private network. Market scripts cannot connect there.&#x22;],[&#x22;\&#x22;resolve\&#x22;&#x22;,&#x22;&#x22;,&#x22;The host name could not be found.&#x22;],[&#x22;\&#x22;connect\&#x22;&#x22;,&#x22;&#x22;,&#x22;The connection to the server failed.&#x22;],[&#x22;\&#x22;timeout\&#x22;&#x22;,&#x22;&#x22;,&#x22;The connection or the handshake took too long.&#x22;],[&#x22;\&#x22;tls\&#x22;&#x22;,&#x22;&#x22;,&#x22;The secure connection failed, for example because of a bad certificate.&#x22;],[&#x22;\&#x22;too_large\&#x22;&#x22;,&#x22;&#x22;,&#x22;A message was larger than 64 MB.&#x22;],[&#x22;\&#x22;bad_url\&#x22;&#x22;,&#x22;&#x22;,&#x22;The URL is not valid, or its scheme is not `wss`. Developer scripts can also use `ws`.&#x22;],[&#x22;\&#x22;handshake\&#x22;&#x22;,&#x22;&#x22;,&#x22;The server replied, but it did not accept a WebSocket connection.&#x22;],[&#x22;\&#x22;lost\&#x22;&#x22;,&#x22;&#x22;,&#x22;The connection was lost without a closing handshake.&#x22;],[&#x22;\&#x22;overflow\&#x22;&#x22;,&#x22;&#x22;,&#x22;Messages arrived faster than the script handled them, and too many messages were waiting.&#x22;],[&#x22;\&#x22;failed\&#x22;&#x22;,&#x22;&#x22;,&#x22;Any other error.&#x22;]]}]" />

  <ApiMember kind="type" name="websocket.State" ret="[[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}]]" expand="[{&#x22;n&#x22;:&#x22;&#x22;,&#x22;values&#x22;:[[&#x22;\&#x22;connecting\&#x22;&#x22;,&#x22;&#x22;,&#x22;The connection is not open yet.&#x22;],[&#x22;\&#x22;open\&#x22;&#x22;,&#x22;&#x22;,&#x22;The connection is open. Messages can be sent and received.&#x22;],[&#x22;\&#x22;closing\&#x22;&#x22;,&#x22;&#x22;,&#x22;`Close` was called, and the closing handshake has started.&#x22;],[&#x22;\&#x22;closed\&#x22;&#x22;,&#x22;&#x22;,&#x22;The connection is closed.&#x22;]]}]" />
</ApiMembers>

## websocket.Options<ApiTag label="object type" />

<ApiMembers>
  <ApiMember kind="prop" name="websocket.Options.headers" summary="Extra headers to send with the handshake request." ret="[[{&#x22;s&#x22;:&#x22;table&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/table#table-1&#x22;},{&#x22;s&#x22;:&#x22;\u003c&#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;\u003e&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" />

  <ApiMember kind="prop" name="websocket.Options.protocols" summary="One or more subprotocols to offer to the server." ret="[[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" />
</ApiMembers>

## websocket.Callbacks<ApiTag label="object type" />

All callbacks are optional. Each callback receives the socket as its first argument.

`close` is always the last callback of a socket, and it is called exactly once, whether the
connection opened or not. When the connection failed or was lost, `error` is called just
before `close`.

<ApiMembers>
  <ApiMember kind="prop" name="websocket.Callbacks.close" summary="Called when the connection is closed. `code` is `1006` when the server did not send a close frame." ret="[[{&#x22;s&#x22;:&#x22;fun&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;ws&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;websocket.Socket&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/networking/websocket#websocketsocket&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;code&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;reason&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" />

  <ApiMember kind="prop" name="websocket.Callbacks.error" summary="Called when the connection failed or was lost." ret="[[{&#x22;s&#x22;:&#x22;fun&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;ws&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;websocket.Socket&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/networking/websocket#websocketsocket&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;error&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;websocket.Error&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/networking/websocket#websocket-Error&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" />

  <ApiMember kind="prop" name="websocket.Callbacks.message" summary="Called when a message arrives. `is_binary` is `true` for a binary message." ret="[[{&#x22;s&#x22;:&#x22;fun&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;ws&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;websocket.Socket&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/networking/websocket#websocketsocket&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;data&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;is_binary&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" />

  <ApiMember kind="prop" name="websocket.Callbacks.open" summary="Called when the connection is open. `protocol` is the subprotocol that the server chose, or `&#x22;&#x22;` if it chose none." ret="[[{&#x22;s&#x22;:&#x22;fun&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;ws&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;websocket.Socket&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/networking/websocket#websocketsocket&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;protocol&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" />
</ApiMembers>

## websocket.Socket<ApiTag label="object type" />

A connection that `websocket.Connect` opened.

<ApiMembers>
  <ApiMember kind="method" name="websocket.Socket:Send" summary="Sends a message. Returns `true` if the message was queued to be sent." args="data, binary?" sig="[{&#x22;s&#x22;:&#x22;websocket.Socket:Send&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;data&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;[, &#x22;},{&#x22;s&#x22;:&#x22;binary&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;data&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}],&#x22;d&#x22;:&#x22;The message to send.&#x22;},{&#x22;n&#x22;:&#x22;binary&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}],&#x22;d&#x22;:&#x22;`true` to send a binary message. The default is `false`, which sends a text message.&#x22;,&#x22;o&#x22;:true}]" returns="[{&#x22;n&#x22;:&#x22;sent&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]}]">
    <ApiNotes>
      Returns `false` and sends nothing in these cases. The socket is not open, which includes the
      time before `open` is called. A text message is not valid UTF-8. More than 64 MB is still
      waiting to be sent.
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="method" name="websocket.Socket:Close" summary="Closes the connection. The `close` callback is called when the closing handshake is done. If the socket is still connecting, `open` is not called. If the socket is already closing or closed, this function does nothing." args="code?, reason?" sig="[{&#x22;s&#x22;:&#x22;websocket.Socket:Close&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;code&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;reason&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;}]" params="[{&#x22;n&#x22;:&#x22;code&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}],&#x22;d&#x22;:&#x22;The close code. The default is `1000`.&#x22;,&#x22;o&#x22;:true},{&#x22;n&#x22;:&#x22;reason&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}],&#x22;d&#x22;:&#x22;The reason for closing, as text.&#x22;,&#x22;o&#x22;:true}]">
    <ApiNotes>
      Throws an error if `code` is not `1000` and not in the range from `3000` to `4999`. Also throws
      an error if `reason` is longer than 123 bytes. If `reason` is not valid UTF-8, it is not sent.
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="method" name="websocket.Socket:State" summary="Returns the state of the connection." args="" sig="[{&#x22;s&#x22;:&#x22;websocket.Socket:State&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;websocket.State&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/networking/websocket#websocket-State&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;websocket.State&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/networking/websocket#websocket-State&#x22;}]]" />
</ApiMembers>
