Files
fx-test/fluxer/fluxer_docs/gateway/close_codes.mdx
Vish 3b9d759b4b feat: add fluxer upstream source and self-hosting documentation
- Clone of github.com/fluxerapp/fluxer (official upstream)
- SELF_HOSTING.md: full VM rebuild procedure, architecture overview,
  service reference, step-by-step setup, troubleshooting, seattle reference
- dev/.env.example: all env vars with secrets redacted and generation instructions
- dev/livekit.yaml: LiveKit config template with placeholder keys
- fluxer-seattle/: existing seattle deployment setup scripts
2026-03-13 00:55:14 -07:00

24 lines
1.2 KiB
Plaintext

---
title: 'Close codes'
description: 'WebSocket close codes used by the Fluxer gateway.'
---
When the gateway closes a connection, it sends a close code indicating why. Some close codes are recoverable (the client should reconnect), while others are not.
## Close code reference
| Code | Name | Description | Reconnect |
|------|------|-------------|----------|
| `4000` | `UNKNOWN_ERROR` | Unknown error occurred | Yes |
| `4001` | `UNKNOWN_OPCODE` | Sent an invalid gateway opcode | Yes |
| `4002` | `DECODE_ERROR` | Sent an invalid payload | Yes |
| `4003` | `NOT_AUTHENTICATED` | Sent a payload before identifying | Yes |
| `4004` | `AUTHENTICATION_FAILED` | Account token is invalid | No |
| `4005` | `ALREADY_AUTHENTICATED` | Sent more than one identify payload | Yes |
| `4007` | `INVALID_SEQ` | Sent an invalid sequence when resuming | Yes |
| `4008` | `RATE_LIMITED` | Sending payloads too quickly | Yes |
| `4009` | `SESSION_TIMEOUT` | Session timed out; reconnect and start a new one | Yes |
| `4010` | `INVALID_SHARD` | Sent an invalid shard when identifying | No |
| `4011` | `SHARDING_REQUIRED` | Session would have handled too many guilds; sharding is required | No |
| `4012` | `INVALID_API_VERSION` | Sent an invalid gateway version | No |