Files
BridgeSwarm/examples/chat-advanced
2026-02-21 23:25:27 -05:00
..
2026-02-21 23:25:27 -05:00
2026-02-21 23:25:27 -05:00
2026-02-21 19:45:15 -05:00
2026-02-21 23:25:27 -05:00

BridgeSwarm Advanced Chat

A feature-rich P2P chat application built on BridgeSwarm with real-time messaging, rooms, file sharing, and more.

Features

Messaging

  • Real-time P2P messaging between tabs/browsers
  • Rich text formatting (bold, italic, code)
  • Emoji support with quick picker
  • Message timestamps
  • System messages for join/leave events

Rooms

  • Multiple chat rooms support
  • Create custom rooms with topics
  • Room member counts
  • Quick room switching

User Management

  • Custom nicknames
  • Online user list with status indicators
  • Unique avatar colors based on nickname
  • User presence tracking

File Sharing

  • Share files directly in chat
  • File name and size display
  • Download shared files

Customization

  • Toggle notifications
  • Sound effects on/off
  • Auto-scroll control
  • Dark theme UI

P2P Architecture

  • No central server required
  • Messages flow directly between peers
  • Uses Hyperswarm for peer discovery
  • Each tab gets unique public key for identity

How to Run

  1. Load the BridgeSwarm extension in your browser
  2. Open index.html in your browser (File → Open or serve locally)
  3. Enter your nickname and click "Join"
  4. Open the same page in another tab or browser to start chatting

Usage

Joining

  • Enter a topic/address (or use default)
  • Enter your nickname
  • Click "Join"

Sending Messages

  • Type in the message box
  • Press Enter or click Send
  • Use bold, italic, and code formatting

Rooms

  • Click "+" next to Rooms to create a new room
  • Click a room to switch to it

Files

  • Click the 📎 button to share a file

Technical Details

  • Uses BridgeSwarm API for P2P networking
  • Each peer maintains connections to other peers
  • Messages are broadcast to all connected peers
  • Presence is shared via periodic broadcasts
  • Unique public key identifies each user/tab