Library / Documentation

MDN: WebSockets API

Browser API reference and guides for opening persistent two-way connections.

BeginnerWebSockets

By MDN Contributors · Mozilla · Added 2026-08-31

Open the docs

All content belongs to MDN Contributors / Mozilla. We only link to it and give credit. Report a problem

Learn this doc

About 30 min left. Your work is saved as you go.

What you want from these docs

Mozilla documents a tool you may use. Decide what you want to do with it, then read only what answers that.

Ideas you will meet

WebSockets
Persistent bidirectional connections for real-time features.

What we already know about this

Our own lessons on these ideas. Read them here before you start, so it makes sense.

Go deeper on this

A path through videos, articles, other case studies and code on the same ideas as MDN: WebSockets API.

  1. Warm upGet the vocabulary first.

  2. WatchHow others solve the same problem, on video.

    Videos belong to their creators and play from YouTube. More on YouTube (opens in a new tab)

  3. ReadEngineers explain it in their own words.

  4. See it in another companyThe same ideas, a different system.

Keep learning

Loading community…