<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: rrobio</title>
    <description>The latest articles on DEV Community by rrobio (@rrvle11).</description>
    <link>https://dev.to/rrvle11</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4025588%2F4b3dc487-cd54-45c2-afe2-18b885e5190a.jpg</url>
      <title>DEV Community: rrobio</title>
      <link>https://dev.to/rrvle11</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rrvle11"/>
    <language>en</language>
    <item>
      <title>How I Built a Sub-15ms Discord Username Sniper with Raw Sockets</title>
      <dc:creator>rrobio</dc:creator>
      <pubDate>Sat, 11 Jul 2026 22:30:51 +0000</pubDate>
      <link>https://dev.to/rrvle11/how-i-built-a-sub-15ms-discord-username-sniper-with-raw-sockets-bf5</link>
      <guid>https://dev.to/rrvle11/how-i-built-a-sub-15ms-discord-username-sniper-with-raw-sockets-bf5</guid>
      <description>&lt;h1&gt;
  
  
  How I Built a Sub-15ms Discord Username Sniper with Raw Sockets
&lt;/h1&gt;

&lt;p&gt;If you've ever tried to grab a rare Discord username, you know the pain. The official Discord client is slow. The API has rate limits. By the time you click "Claim," someone else already has it.&lt;/p&gt;

&lt;p&gt;So I built &lt;strong&gt;&lt;a href="https://blosm.lol" rel="noopener noreferrer"&gt;blosm&lt;/a&gt;&lt;/strong&gt; — a Discord username sniping platform that claims usernames in under 15ms using raw socket architecture. It now handles 1,200+ active users with a 99.9% success rate.&lt;/p&gt;

&lt;p&gt;Here's the technical breakdown.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;Discord's public API is designed for general-purpose use, not speed. When a username drops, hundreds of people are trying to grab it simultaneously. The official client adds overhead through:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;HTTP connection overhead&lt;/li&gt;
&lt;li&gt;JSON serialization/deserialization&lt;/li&gt;
&lt;li&gt;Rate limit handling (Discord aggressively throttles)&lt;/li&gt;
&lt;li&gt;TLS handshake latency on every request&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By the time a normal request completes, a sniping tool running raw sockets has already claimed the name.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Architecture
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Raw Socket Layer
&lt;/h3&gt;

&lt;p&gt;The core of blosm bypasses Discord's HTTP API entirely. Instead, it communicates directly through WebSocket connections at the socket level.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Traditional approach:
Client → HTTPS Request → Discord API → Response (50-200ms)

blosm approach:
Raw Socket → WebSocket Frame → Discord Gateway → Response (&amp;lt;15ms)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This eliminates:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;HTTP connection setup overhead&lt;/li&gt;
&lt;li&gt;Repeated TLS handshakes (connection is persistent)&lt;/li&gt;
&lt;li&gt;JSON parsing on the hot path&lt;/li&gt;
&lt;li&gt;Rate limit buckets (gateway-level operations have different limits)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  C++ Socket Engine
&lt;/h3&gt;

&lt;p&gt;The claim engine is written in C++ for maximum performance. The key decisions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Custom SSL fingerprinting&lt;/strong&gt; — mimics legitimate Discord client behavior&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Non-blocking I/O&lt;/strong&gt; — handles thousands of concurrent connections on a single thread&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Memory-mapped username queues&lt;/strong&gt; — zero-copy operations for claim processing&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lock-free data structures&lt;/strong&gt; — no mutex contention under high load
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Simplified claim flow&lt;/span&gt;
&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;claim_username&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;string&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;username&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="n"&gt;Token&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Build Discord gateway payload directly (no JSON library)&lt;/span&gt;
    &lt;span class="k"&gt;auto&lt;/span&gt; &lt;span class="n"&gt;payload&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;build_gateway_payload&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;OPCODE_MESSAGE_CREATE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;"content"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"/name "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;username&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;

    &lt;span class="c1"&gt;// Send raw bytes over persistent WebSocket&lt;/span&gt;
    &lt;span class="n"&gt;socket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;

    &lt;span class="c1"&gt;// Response handled by event loop — no blocking&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Anti-Detection System
&lt;/h3&gt;

&lt;p&gt;Discord actively fights automation. blosm uses multiple layers to avoid detection:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;SSL Fingerprint Rotation&lt;/strong&gt; — rotates JA3 fingerprints to look like different clients&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;User-Agent Pool&lt;/strong&gt; — 200+ realistic Discord client user agents&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Proxy Distribution&lt;/strong&gt; — requests spread across 4,200+ residential and datacenter proxies&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Behavioral Timing&lt;/strong&gt; — adds human-like jitter to claim patterns&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Token Health Monitoring&lt;/strong&gt; — automatically rotates compromised tokens&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  The Proxy Network
&lt;/h3&gt;

&lt;p&gt;Proxies are critical for username sniping. Each claim attempt needs to come from a different IP to avoid rate limiting.&lt;/p&gt;

&lt;p&gt;blosm maintains a global pool of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Residential proxies&lt;/strong&gt; — for highest success rate&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Datacenter proxies&lt;/strong&gt; — for speed when rate limits aren't a concern&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ISP proxies&lt;/strong&gt; — middle ground, good balance of speed and reliability&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The proxy manager health-checks every proxy every 30 seconds and removes dead ones automatically. During peak hours, it handles 50,000+ connection attempts.&lt;/p&gt;

&lt;h3&gt;
  
  
  Auto-Snipe Engine
&lt;/h3&gt;

&lt;p&gt;The auto-snipe engine monitors username availability in real-time:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Regex Pattern Matching&lt;/strong&gt; — users define patterns like &lt;code&gt;^[a-z]{3}$&lt;/code&gt; for 3-letter names&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Availability Checking&lt;/strong&gt; — constant polling of Discord's name resolution endpoint&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Priority Queue&lt;/strong&gt; — claims are prioritized by user plan (Elite &amp;gt; Standard)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Instant Claim&lt;/strong&gt; — when availability is detected, claim fires in &amp;lt;15ms
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Username detected available
  → Priority queue lookup (0.1ms)
  → Token selection (0.2ms)
  → Proxy selection (0.1ms)
  → Raw socket claim (10-15ms)
  → Webhook notification (async)
  Total: ~15ms end-to-end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Scaling to 1,200+ Users
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The Hard Parts
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Concurrency&lt;/strong&gt;: Each user can have 10+ patterns running simultaneously. That's 12,000+ active monitors.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Rate Limits&lt;/strong&gt;: Discord's gateway has connection rate limits. blosm multiplexes multiple users over shared connections using Discord's session management.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Token Management&lt;/strong&gt;: Each claim requires a valid, unthrottized token. The system manages a pool of tokens per user and automatically rotates when one gets rate-limited.&lt;/p&gt;

&lt;h3&gt;
  
  
  What Actually Broke (So Far)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Week 2&lt;/strong&gt;: Socket connection pool leaked under heavy load. Fixed with aggressive connection timeout and cleanup.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Month 1&lt;/strong&gt;: Discord changed their gateway protocol slightly. Had to update the payload parser within 2 hours.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Month 2&lt;/strong&gt;: A user ran 500 regex patterns simultaneously, DoS'd the claim queue. Added per-user concurrency limits.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Tech Stack
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Component&lt;/th&gt;
&lt;th&gt;Technology&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Claim Engine&lt;/td&gt;
&lt;td&gt;C++ (custom socket library)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Backend API&lt;/td&gt;
&lt;td&gt;Node.js + Express&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Dashboard&lt;/td&gt;
&lt;td&gt;Next.js + Tailwind&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Database&lt;/td&gt;
&lt;td&gt;PostgreSQL + Redis&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Monitoring&lt;/td&gt;
&lt;td&gt;Custom metrics pipeline&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Infrastructure&lt;/td&gt;
&lt;td&gt;Docker on bare metal&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Results
&lt;/h2&gt;

&lt;p&gt;After 6 months of building and iterating:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;8-15ms&lt;/strong&gt; average claim latency&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;99.9%&lt;/strong&gt; uptime&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;1,200+&lt;/strong&gt; active users&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;4,200+&lt;/strong&gt; proxies in the pool&lt;/li&gt;
&lt;li&gt;Sub-second time from detection to claim&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What's Next
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;AI-powered username prediction (predicting which names will become available)&lt;/li&gt;
&lt;li&gt;Multi-platform support (Roblox, Twitch, etc.)&lt;/li&gt;
&lt;li&gt;Public API for developers&lt;/li&gt;
&lt;li&gt;Browser extension for real-time availability checking&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;If you're interested in the project, check it out at &lt;strong&gt;&lt;a href="https://blosm.lol" rel="noopener noreferrer"&gt;blosm.lol&lt;/a&gt;&lt;/strong&gt;. I also have a Discord community where we discuss the technical challenges of building at this scale: &lt;a href="https://discord.com/invite/t8JSM8Asee" rel="noopener noreferrer"&gt;Join the Discord&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Happy to answer questions about the architecture in the comments.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Built with curiosity, caffeine, and way too many Discord API documentation tabs open.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
