PROTOCOLS · WEBSOCKET
Load test your real-time app with every connection held open
Chat, live dashboards, multiplayer games and AI assistants keep thousands of connections open and stream messages both ways. Gatling holds those connections at production concurrency and times every message you wait for, so you see dropped messages and slow replies before your users do.


Measure the reply your users wait for, not the handshake
An HTTP test sees a fast handshake and stops. The real work starts after it: messages sent, bursts of replies, timeouts and reconnects on a connection that stays open for minutes. Gatling checks the frames you expect and times them, per virtual user, under load.
From connect to the last reply, in one Gatling test
Each connect, send and check appears side by side in the same Gatling report.
How Gatling does it
Wait for the frame you expect
Await text or binary messages with a timeout and check them with regex or JSON path. A reply that never arrives fails the test.
The right reply in a busy stream
Filter which messages a check considers, so a reply is found among broadcasts and keep-alives. Save values for the next message.
Reconnects and several sockets
Reconnect sockets the server closes, cap the attempts, and open several named sockets per virtual user.
Where teams load test WebSocket
WebSocket carries the moments your users see live. These are the flows to test before a launch, a match day or a peak.
Chatbots under real concurrency
Thousands of conversations at once, with typing pauses and mid-conversation disconnects. Measure response latency as sessions grow.
Messages to every member
Chat rooms, shared documents and presence. Measure the time from a message sent to the replies that come back.
Prices, scores and dashboards
Streams that push updates to every connected client. Measure delivery time and missed messages as connections grow.
Multiplayer sessions
Players sending moves and receiving game state in real time. Measure round trips and dropped connections at peak.
Push to every open session
A broadcast to every connected user at once. Measure how long the last user waits and whether every message arrives.
A different architecture?
Tell us about the real-time flows that matter to your business. We’ll help you design the right Gatling test.
WebSocket testing built into Gatling
Connect, send, check, match, reconnect and close ship with the Gatling HTTP SDK. No plugin to install, no custom client to maintain.
Secure connections
Connect over wss://, with the same HTTP protocol settings as the rest of your test, configured as code.
Private Locations
Run next to real-time services that aren’t reachable from the internet, with no inbound access to open.
Performance gates with assertions
Set assertions on response time and failed checks per message. If one fails, the Gatling test fails and so does the build.
Live Session
See Gatling in action
Build, run, and interpret your first load test. A practical session: by the end, you'll know exactly what Enterprise gives you out of the box.
.png)
Your first Gatling test for WebSocket
A step-by-step guide, a hands-on article and the reference docs from our engineers. Pick the one that fits your stack.
WebSocket load testing in JavaScript
Load testing an AI chatbot over WebSocket with the Gatling JavaScript SDK.
Follow the WebSocket guide
A test server, a Gatling simulation that connects, sends and checks replies, and your first run.
WebSocket reference
Connect, send, await and check, matching, reconnects and close.
Clone the guide project
The test server and the Java simulation from the guide, ready to run.
HTTP protocol
Base URLs, headers and TLS shared by your HTTP and WebSocket requests.
Server-Sent Events
One-way streams from server to client, with the same check model.
One platform for every protocol you run
Same Gatling SDK, same reports, same infrastructure.
gRPC
Unary and streaming calls built from your .proto files.
WebSocket
Real-time connections and messages.
MQTT
IoT devices and brokers at fleet scale.
Kafka
Event-driven flows, end to end.
GraphQL
Queries, mutations and subscriptions.
Also supported: HTTP, JDBC, Server-Sent Events and JMS. See the full tech stack›
WebSocket load testing, answered
What teams ask before they run their first WebSocket test with Gatling.
Is WebSocket support included in Gatling Community Edition?
Yes. WebSocket support is part of the Gatling HTTP SDK, with no separate plugin. Gatling Enterprise adds distributed load generators, run history and shared reports.
How do I check messages in a busy stream?
Await a message with a timeout and check it with regex, JSON path or byte checks. Matching filters which messages a check considers, so broadcasts and keep-alives are ignored.
What happens when the server closes the connection?
Gatling can reconnect sockets closed by the server, with a maximum number of attempts, and run a chain of actions after each reconnect.
Can one Gatling test mix HTTP and WebSocket?
Yes. One scenario can log in over HTTP, open a WebSocket, exchange messages and close it, with every step in the same report.
Can a virtual user open several WebSockets?
Yes. Give each socket its own name, and every action targets the socket you choose.
Which Gatling versions and languages are supported?
WebSocket support ships with the Gatling HTTP SDK in Java, Kotlin, Scala, JavaScript and TypeScript.
Find out how many live users your app can hold
Bring one real-time flow that matters to your business. We’ll write the test with you and run it against your service in a Gatling Enterprise trial.
Find out where your real-time app breaks
Bring one real-time flow that matters to your business. We'll show you how to test it at production scale with Gatling Enterprise.
Need technical references and tutorials?
Running WebSocket tests locally first?

