Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Webrtc Pro

ASecurity

Build real-time audio/video with WebRTC: signaling, peer connections, media devices, and TURN infrastructure. Use for video calls and peer-to-peer media.

2 stars
0 votes
0 copies
0 views
Added 9/29/2026
ai-agentsgo

Works with

cli

Security Analysis

A100/100

Scanned 9/29/2026

$npx -y skills add aicodedecode/awesome-muse-skills --skill webrtc-pro --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Webrtc Pro?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Webrtc Pro
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/aicodedecode-webrtc-pro/badge)](https://www.skillsdirectory.com/skills/aicodedecode-webrtc-pro)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: webrtc-pro
description: Build real-time audio/video with WebRTC: signaling, peer connections, media devices, and TURN infrastructure. Use for video calls and peer-to-peer media.
category: web-development
---

# WebRTC Pro

A practical guide to WebRTC: browser-to-browser real-time audio, video, and data — signaling, peer connections, NAT traversal (STUN/TURN), media handling, and the infrastructure decisions that determine whether calls actually connect.

## Overview

WebRTC enables **peer-to-peer** real-time communication in the browser: audio/video calls, screen sharing, and data channels — with encryption (DTLS-SRTP) built in. The catch: browsers can't find each other alone. You need **signaling** (your server exchanging session descriptions/ICE candidates) and **NAT traversal** (STUN to discover addresses, TURN to relay when direct fails). Media flows peer-to-peer; signaling and TURN are your infrastructure.

## When to use

- 1:1 or group video/voice calls.
- Screen sharing.
- Peer-to-peer data transfer (files, game state) via data channels.
- Live broadcasting with sub-second latency (WHIP/WHEP or custom).

## Core concepts

- **Signaling.** Your WebSocket/HTTP channel exchanging: offers/answers (SDP session descriptions) and ICE candidates. Not standardized — you design it. Keep it simple: `{ type: 'offer'|'answer'|'candidate', ... }`.
- **RTCPeerConnection.** The core object: `addTrack`/`createOffer` → set local/remote descriptions → ICE gathering → connected. One per peer (mesh) or per SFU uplink.
- **ICE.** Interactive Connectivity Establishment: tries host → STUN (server-reflexive) → TURN (relay) candidates, picks the best working path. Most failures are ICE failures.
- **STUN.** Discovers your public address (`stun:stun.l.google.com:19302` or your own). Cheap, stateless.
- **TURN.** Relays media when direct connection fails (symmetric NATs, restrictive firewalls). **You must run TURN** — without it, 10–30% of calls fail. Bandwidth costs money; budget it.
- **Media devices.** `getUserMedia({ video, audio })` — permission prompt; handle denial gracefully. `getDisplayMedia` for screen share. Device selection via `enumerateDevices`.
- **Data channels.** `createDataChannel` — low-latency peer-to-peer messaging (chat in calls, file transfer, game state). Ordered/reliable or unordered/unreliable modes.
- **Topologies.** Mesh (each peer connects to each — fine for ≤4), SFU (Selective Forwarding Unit server routes streams — the standard for groups), MCU (server mixes — heavy, legacy).

## Practical workflow

**1. Signaling flow (1:1).**
```
A: pc.createOffer() → setLocalDescription → send offer via signaling
B: receive offer → setRemoteDescription → createAnswer → setLocalDescription → send answer
A: receive answer → setRemoteDescription
Both: exchange ICE candidates as they trickle (onicecandidate → signaling → addIceCandidate)
```

**2. Basic setup.**
```js
const pc = new RTCPeerConnection({ iceServers: [
  { urls: 'stun:stun.example.com:3478' },
  { urls: 'turn:turn.example.com:3478', username: 'user', credential: 'pass' },
]});
const stream = await navigator.mediaDevices.getUserMedia({ video: true, audio: true });
stream.getTracks().forEach(t => pc.addTrack(t, stream));
pc.ontrack = (e) => { remoteVideo.srcObject = e.streams[0]; };
```

**3. TURN.** Deploy coturn (or managed TURN). Generate time-limited credentials server-side (don't hardcode). Test with TURN-only (block UDP/host candidates) to prove relay works.

**4. Call UX.** Pre-call device check (camera/mic preview + selection); in-call: mute, camera toggle, screen share, connection quality indicator; handle `iceconnectionstatechange` → "reconnecting..." UI → recovery or clean failure.

**5. Group calls.** Don't mesh beyond ~4. Use an SFU (LiveKit, Janus, mediasoup, or managed) — clients publish once, SFU forwards selectively.

## Common pitfalls

- **No TURN server.** "Works on my network" then fails for users behind corporate/symmetric NATs. TURN is mandatory infrastructure, not optional.
- **Hardcoded TURN credentials.** Long-lived credentials in client code get abused (bandwidth theft). Time-limited credentials minted server-side.
- **Mesh for groups.** 8-person mesh = 56 connections, everyone's uplink saturated. SFU for groups.
- **Ignoring ICE failures.** `iceConnectionState === 'failed'` needs restart (`pc.restartIce()`) or re-offer — not a silent dead call.
- **getUserMedia without fallback.** Permission denied / no devices = crash without handling. Graceful degradation (audio-only, or join muted).
- **Echo.** Open speakers + mic = feedback. Advise headsets; use `echoCancellation: true`; the browser helps but physics wins.
- **Signaling as an afterthought.** Dropped signaling messages = stuck calls. Reliable transport (WebSocket with reconnection) + message acks for critical signals.
- **No stats monitoring.** `pc.getStats()` reveals bitrate, packet loss, jitter — without it you're blind to quality issues. Monitor and adapt (degrade video before dropping audio).
- **Bandwidth blindness.** HD video × N participants costs real TURN/server bandwidth. Budget per concurrent user; consider simulcast (SFU sends appropriate quality per receiver).
- **Mobile battery/heat.** Sustained WebRTC on phones drains fast. Prefer audio-first defaults on mobile; pause video when backgrounded.

Attribution

aicodedecodeaicodedecode
View sourceSee grades on GitHubMore from aicodedecode →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Caveman

Terse caveman voice: answer first, fluff gone, every technical fact kept. Use for /caveman, "caveman mode", "talk like caveman", "be brief", "less tokens". Stays on until "stop caveman" or "normal mode".

1100021 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

698621 votes

Writing Skills

Create and manage Claude Code skills in HASH repository following Anthropic best practices. Use when creating new skills, modifying skill-rules.json, understanding trigger patterns, working with hooks, debugging skill activation, or implementing progressive disclosure. Covers skill structure, YAML frontmatter, trigger types (keywords, intent patterns), UserPromptSubmit hook, and the 500-line rule. Includes validation and debugging with SKILL_DEBUG. Examples include rust-error-stack, cargo-dep...

3931 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3421 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Amp, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Grok Build, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

741 votes
View all in ai-agents →