Limit client and upstream messagesv3.1+

Limit both client and upstream messages.

You can also use these settings to raise the default limits. Kong Gateway applies the following default limits to incoming messages for all WebSocket services:

  • client: 1048576 (1MiB)
  • upstream: 16777216 (16MiB)

Set up the plugin

Add this section to your declarative configuration file:

_format_version: "3.0"
plugins:
  - name: websocket-size-limit
    config:
      client_max_payload: 4096
      upstream_max_payload: 1048576
Copied to clipboard!

Did this doc help?

Something wrong?

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!