A Step-by-Step Tutorial of Building a Simple Peer-to-Peer WebSocket Application

This tutorial series walks you through the simple steps of building an HTML5 WebSocket app, demonstrating the power of the publish/subscribe development pattern directly in JavaScript. Our sample is almost as simple as a Chat app, the “Hello World” app of the WebSocket world, but is a tad more visual and dynamic. This tutorial requires a WebSocket server. We will use, which hosts the JMS Edition of Kaazing WebSocket Gateway, Kaazing’s high-performance enterprise-grade WebSocket Server. All you’ll need to do is create a WebSocket connection to this server directly from your browser and start “talking” (read: send messages) to it from your browser. On the client side, you can use any modern browser, supported by JSFiddle (learn more about JSFiddle). For editing the code, the tutorial uses JSFiddle, hosting the "before" and "after" state for every task you're performing.

  • Tutorial teaching how to build a peer-to-peer application
  • No WebSocket server installation needed
  • Use JSFiddle, a browser-based code editing and execution environment
Building a Peer-to-Peer App
Building a Peer-to-Peer App
Building a Peer-to-Peer App
Related Demos / Find more demos
  • Light Table

    Light Table

    A collaborative demo allowing multiple users to lay out photos on the screen real-time. Users can move, resize, rota...
  • A Parallel Universe Without a Mailman

    A Parallel Universe Without a Mailman

    This 5 min video walks you through the challenges a parallel universe of ours is facing where they don’t have a mail...
  • Killer JavaFX App

    Killer JavaFX App

    This application showcases that you can easily build high speed real-time Web applications using JavaFX as the view ...