websocket.mdx 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. ---
  2. title: WebSocket
  3. description: Real-time status updates via WebSocket. Connect once at
  4. <code>ws://<panel>/ws</code> to receive a stream of JSON messages without
  5. polling. Requires an authenticated session cookie (Bearer token auth is not
  6. supported). Each message has a <code>type</code> field that identifies the
  7. payload shape.
  8. full: true
  9. _openapi:
  10. preload:
  11. - ./public/openapi.json
  12. toc:
  13. - depth: 2
  14. title: Upgrade an HTTP connection to a WebSocket. Requires an authenticated
  15. session cookie (Bearer token auth is not supported here). Returns 101
  16. Switching Protocols on success. The server then pushes JSON messages
  17. described below.
  18. 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'
  19. structuredData:
  20. headings:
  21. - content: Upgrade an HTTP connection to a WebSocket. Requires an authenticated
  22. session cookie (Bearer token auth is not supported here). Returns 101
  23. Switching Protocols on success. The server then pushes JSON messages
  24. described below.
  25. 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
  26. contents: []
  27. ---
  28. {/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}
  29. export default function Layout(props) {
  30. const { APIPage, OpenAPIPage } = props.components ?? {};
  31. // "APIPage" is the old name from v10, this allows both for backward compatibility
  32. const Comp = OpenAPIPage ?? APIPage;
  33. return (
  34. <>
  35. {props.children}
  36. <Comp document="./public/openapi.json" webhooks={[]} operations={[{"path":"/ws","method":"get"}]} showTitle />
  37. </>
  38. );
  39. }