---
title: WebSocket
description: >-
  دریافت به‌روزرسانی‌های وضعیت در لحظه از طریق WebSocket. تنها یک‌بار به
  <code>ws://<panel>/ws</code> متصل شوید تا بدون نیاز به polling، جریانی از
  پیام‌های JSON دریافت کنید. به یک کوکی نشست احرازهویت‌شده نیاز دارد (احرازهویت با
  توکن Bearer پشتیبانی نمی‌شود). هر پیام دارای یک فیلد <code>type</code> است که
  شکل داده‌ی آن را مشخص می‌کند.
full: true
_openapi:
  preload:
    - ./public/openapi.json
  toc:
    - depth: 2
      title: >-
        Upgrade an HTTP connection to a WebSocket. Requires an authenticated
        session cookie (Bearer token auth is not supported here). Returns 101
        Switching Protocols on success. The server then pushes JSON messages
        described below.
      url: >-
        #upgrade-an-http-connection-to-a-websocket-requires-an-authenticated-session-cookie-bearer-token-auth-is-not-supported-here-returns-101-switching-protocols-on-success-the-server-then-pushes-json-messages-described-below
  structuredData:
    headings:
      - content: >-
          Upgrade an HTTP connection to a WebSocket. Requires an authenticated
          session cookie (Bearer token auth is not supported here). Returns 101
          Switching Protocols on success. The server then pushes JSON messages
          described below.
        id: >-
          upgrade-an-http-connection-to-a-websocket-requires-an-authenticated-session-cookie-bearer-token-auth-is-not-supported-here-returns-101-switching-protocols-on-success-the-server-then-pushes-json-messages-described-below
    contents: []
---

{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}

export default function Layout(props) {
  const { APIPage, OpenAPIPage } = props.components ?? {};
  // "APIPage" is the old name from v10, this allows both for backward compatibility
  const Comp = OpenAPIPage ?? APIPage;
  return (
    <>
      {props.children}
      <Comp document="./public/openapi.json" webhooks={[]} operations={[{"path":"/ws","method":"get"}]} showTitle />
    </>
  );
}