What does the WebRTC SDP & ICE Candidate Inspector do?
The WebRTC SDP & ICE Candidate Inspector helps WebRTC developers, VoIP engineers, and video streaming architects parse, inspect, and lint Session Description Protocol (SDP) Offer/Answer exchanges and ICE candidate lines (a=candidate:). It visualizes media descriptions (m=audio, m=video), checks DTLS setup roles, audits payload types, and provides 1-click IP/credential sanitization for safe public log sharing.
Core Concepts
Understanding WebRTC Session Negotiation:
- SDP Offer / Answer: Textual session descriptions exchanged via signaling (SIP/WebSocket) detailing media capabilities, codecs, and transport parameters.
- DTLS Setup Roles (
a=setup:): Negotiates active/passive TLS roles during handshake (actpass,active,passive). - ICE Candidate Types:
host: Local network interface IP address.srflx(Server Reflexive): Public IP assigned by STUN server.relay: Relayed IP assigned by TURN server.
How to use the tool?
- Input Session Data: Paste your SDP Offer and Answer strings, or input a single
a=candidate:line. - Real-time Diagnostics: The linter audits DTLS setup roles, codec payload matches, and ICE credentials.
- 1-Click Sanitizer: Click
🔒 1-Click Sanitize IPs & Keysto replace private IPv4/IPv6 addresses and ufrag/pwd tokens with safe placeholders before sharing logs.
Related Developer Utilities
If you work with network protocols and media streaming, explore these complementary tools:
- CIDR Subnet Calculator: Calculate IPv4 subnet boundaries, broadcast addresses, and netmasks.
- Port Lookup Utility: Search common TCP/UDP service ports and network protocols.
REST API Integration
Blueutils provides a free REST API endpoint (POST https://blueutils.com/api/network/webrtc-sdp-inspector) to programmatically lint SDP documents and deconstruct ICE candidate strings.
API Request Parameters
| Name | Type | Description | Example |
|---|---|---|---|
offerSdp |
String | Local SDP offer text. | "v=0\r\na=setup:actpass\r\nm=audio..." |
answerSdp |
String | Remote SDP answer text. | "v=0\r\na=setup:active\r\nm=audio..." |
candidateLine |
String | Standalone a=candidate:... line. |
"a=candidate:1 1 UDP 2122260223 192.168.1.1 5000 typ host" |
sanitize |
Boolean | Whether to anonymize IP addresses and credentials. Default false. |
false |
API Request Payload Examples
cURL
curl -X POST https://blueutils.com/api/network/webrtc-sdp-inspector \
-H "Content-Type: application/json" \
-d '{
"candidateLine": "a=candidate:42349 1 UDP 2122260223 192.168.1.100 54321 typ host"
}'Python
import requests
url = "https://blueutils.com/api/network/webrtc-sdp-inspector"
payload = {
"candidateLine": "a=candidate:42349 1 UDP 2122260223 192.168.1.100 54321 typ host"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())Java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String jsonPayload = """
{
"candidateLine": "a=candidate:42349 1 UDP 2122260223 192.168.1.100 54321 typ host"
}
""";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://blueutils.com/api/network/webrtc-sdp-inspector"))
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(jsonPayload))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}API Response Parameters
| Name | Type | Description | Example |
|---|---|---|---|
isValid |
Boolean | Indicates whether parsing succeeded. | true |
offer |
Object | Parsed Offer object with mediaBlocks, iceCandidates, dtlsFingerprint. |
{ "mediaBlocks": [...] } |
lintIssues |
Array | Array of linter warnings and error objects { type, text }. |
[{"type":"warning","text":"..."}] |
standaloneCandidate |
Object | Deconstructed ICE candidate object. | { "type": "host", "protocol": "UDP", "ip": "192.168.1.100" } |
API Response Payload Examples
Success Response (HTTP 200 OK)
{
"isValid": true,
"standaloneCandidate": {
"foundation": "42349",
"component": "RTP (1)",
"protocol": "UDP",
"priority": "2122260223",
"ip": "192.168.1.100",
"port": "54321",
"type": "host"
},
"lintIssues": []
}Validation Failure Response (HTTP 400 Bad Request)
{
"isValid": false,
"error": "Please enter a SDP Offer, Answer, or ICE candidate line to inspect."
}Rate Limit Exceeded Response (HTTP 429 Too Many Requests)
{
"error": "API rate limit exceeded. Please wait or contact support@blueutils.com."
}Why use an API to inspect WebRTC SDPs?
Integrating the WebRTC SDP Inspector API into automated testing tools and WebRTC monitoring backend services offers key benefits:
- Automated Signaling Audits: Validate DTLS setup roles and codec payloads before establishing PeerConnections.
- ICE Candidate Analytics: Deconstruct candidate priorities and transport types during call quality debugging.
Native Usage
How to parse WebRTC SDPs programmatically across environments:
Node.js (JavaScript)
function parseIceCandidate(line) {
const parts = line.replace('a=candidate:', '').trim().split(/\s+/);
return {
foundation: parts[0],
component: parts[1] === '1' ? 'RTP' : 'RTCP',
protocol: parts[2],
priority: parts[3],
ip: parts[4],
port: parts[5],
type: parts[7]
};
}
console.log(parseIceCandidate('a=candidate:42349 1 UDP 2122260223 192.168.1.100 54321 typ host'));Linux (Bash Shell)
#!/bin/bash
LINE="a=candidate:42349 1 UDP 2122260223 192.168.1.100 54321 typ host"
echo "$LINE" | awk '{print "IP:" $5 " Port:" $6 " Protocol:" $3 " Type:" $8}'Python
def parse_ice_candidate(candidate_str):
parts = candidate_str.replace("a=candidate:", "").strip().split()
return {
"ip": parts[4],
"port": parts[5],
"protocol": parts[2],
"type": parts[7]
}
print(parse_ice_candidate("a=candidate:42349 1 UDP 2122260223 192.168.1.100 54321 typ host"))Java
public class SdpParser {
public static void main(String[] args) {
String line = "a=candidate:42349 1 UDP 2122260223 192.168.1.100 54321 typ host";
String[] parts = line.replace("a=candidate:", "").trim().split("\\s+");
System.out.println("Type: " + parts[7] + ", IP: " + parts[4] + ", Port: " + parts[5]);
}
}