Skip to main content
1008

Policy Violation

Sent by: BothDo not retry

1008 Policy Violation is a generic close code for when an endpoint receives a message that violates its policies – authorization failure, rate limiting, content policy enforcement, or a custom application rule. It is intentionally vague to avoid leaking policy details to the client.

Description

1008 is used when the specific reason for closure should not be disclosed to the client. It covers: receiving a message while unauthenticated, exceeding rate limits, sending a message type not allowed by the application, or violating content policies. The optional close reason string may provide a generic explanation but should not expose internal security details.

Common Causes

  • Rate limit exceeded
  • Unauthorized message received
  • Content policy violation
  • Application-specific rule triggered

Code

1008

RFC

RFC 6455

Sent By

Both

Retry

No