tests.ws

WebSocket Guides

Practical WebSocket implementation guides with code examples for every popular language and library.

JavaScript

Cloudflare WebSocket Guide

Use Cloudflare with WebSocket connections. Covers proxy settings, Workers, Durable Objects, and Cloudflare Tunnel for WebSocket apps.

JavaScript

AWS WebSocket API Gateway Guide

Build serverless WebSocket APIs with AWS API Gateway and Lambda. Covers routes, connections, broadcasting, and deployment.

TypeScript

Angular WebSocket Guide

Build real-time Angular apps with WebSocket using RxJS webSocket, services, and Socket.IO. Covers observables, reconnection, and testing.

C++

C++ WebSocket Guide

Build WebSocket servers and clients in C++ using Boost.Beast and websocketpp. Covers setup, async I/O, TLS, and performance tuning.

JavaScript

Binance WebSocket API Guide

Connect to Binance WebSocket streams for real-time market data. Covers ticker, depth, kline streams, user data, and reconnection.

C++

ESP32 and ESP8266 WebSocket Guide

Build WebSocket servers and clients on ESP32 and ESP8266 for IoT projects. Covers ArduinoWebSockets, async servers, and sensor streaming.

Dart

Flutter WebSocket Guide

Build real-time Flutter apps with WebSocket. Covers dart:io WebSocketChannel, state management, reconnection, and cross-platform tips.

Go

Go WebSocket with gorilla/websocket

Build WebSocket servers and clients in Go using gorilla/websocket. Covers setup, upgrading connections, messaging, broadcasting, and production tips.

C#

C# WebSocket with SignalR

Build real-time WebSocket applications in C# using ASP.NET Core SignalR. Covers hubs, groups, authentication, scaling, and JavaScript client integration.

Python

Django and FastAPI WebSocket Guide

Build WebSocket servers in Python with Django Channels and FastAPI. Setup, routing, consumers, broadcasting, and deployment.

TypeScript

GraphQL Subscriptions over WebSocket

Implement GraphQL subscriptions with WebSocket using graphql-ws, Apollo Client, and NestJS. Real-time data streaming with code examples.

Java

Java WebSocket with Spring

Build WebSocket servers in Java using Spring Boot. Covers STOMP messaging, raw WebSocket handlers, SockJS fallback, and production configuration.

JavaScript

JavaScript WebSocket API Guide

Learn how to use the native JavaScript WebSocket API to open persistent connections, send and receive real-time messages, and handle reconnection.

Kotlin

Kotlin and Android WebSocket Guide

Build WebSocket clients on Android with OkHttp and Ktor. Covers connection management, lifecycle handling, and background operation.

PHP

Laravel WebSocket Guide

Add real-time WebSocket support to Laravel with Laravel Reverb, Pusher, and beyondcode/laravel-websockets. Broadcasting, channels, and events.

TypeScript

NestJS WebSocket Guide

Build WebSocket servers with NestJS using gateways, decorators, and Socket.IO or ws adapters. Covers rooms, guards, and testing.

JavaScript

Next.js WebSocket Guide

Add WebSocket support to Next.js apps. Covers custom server setup, Socket.IO integration, and alternatives for serverless deployments.

Nginx

Nginx WebSocket Proxy Configuration

Configure Nginx as a reverse proxy for WebSocket connections. Covers proxy_pass, timeouts, TLS termination, and load balancing.

JavaScript

Node.js WebSocket Server with ws

Build a WebSocket server in Node.js using the ws library. Covers setup, messaging, broadcasting, rooms, authentication, and production configuration.

PHP

PHP WebSocket with Ratchet

Build WebSocket servers in PHP using Ratchet. Covers installation, message handling, broadcasting, rooms, authentication, and deployment.

Python

Python WebSocket with websockets

Build Python WebSocket servers and clients using the websockets library with asyncio, covering setup, messaging patterns, and production deployment.

JavaScript

React WebSocket Guide

Build real-time React apps with WebSocket. Covers hooks, state management, reconnection, and React Native WebSocket integration.

JavaScript

Redis Pub/Sub with WebSocket

Scale WebSocket servers with Redis Pub/Sub for cross-instance broadcasting. Covers setup, patterns, and alternatives like MQTT and NATS.

Rust

Rust WebSocket with Tungstenite

Build WebSocket servers and clients in Rust using tungstenite and tokio-tungstenite. Covers async connections, messaging, broadcasting, and error handling.

JavaScript

Socket.IO Guide - Real-Time with Node.js

Learn how Socket.IO builds on WebSocket to provide automatic reconnection, rooms, namespaces, and event-based communication for real-time apps.

JavaScript

STOMP over WebSocket Guide

Use the STOMP messaging protocol over WebSocket with stompjs, Spring Boot, and RabbitMQ. Covers setup, topics, queues, and authentication.

Swift

Swift and iOS WebSocket Guide

Build WebSocket clients in Swift using URLSessionWebSocketTask and Starscream. Covers connection management, background handling, and SwiftUI integration.