<?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: Anton Kopylov</title>
    <description>The latest articles on DEV Community by Anton Kopylov (@tonic20).</description>
    <link>https://dev.to/tonic20</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%2F4012468%2F36c4138d-7ced-4ff7-8aa1-4f1975d892bd.jpg</url>
      <title>DEV Community: Anton Kopylov</title>
      <link>https://dev.to/tonic20</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tonic20"/>
    <language>en</language>
    <item>
      <title>HTTP/3 on Kamal, and a PR to Basecamp</title>
      <dc:creator>Anton Kopylov</dc:creator>
      <pubDate>Thu, 02 Jul 2026 15:28:15 +0000</pubDate>
      <link>https://dev.to/tonic20/http3-on-kamal-and-a-pr-to-basecamp-33oa</link>
      <guid>https://dev.to/tonic20/http3-on-kamal-and-a-pr-to-basecamp-33oa</guid>
      <description>&lt;p&gt;A few days ago I read &lt;a href="https://savearoundtrip.com/" rel="noopener noreferrer"&gt;a good writeup&lt;/a&gt; on how much &lt;strong&gt;HTTP/3&lt;/strong&gt; can shave off page loads — QUIC drops a round trip on connection setup and survives network changes without renegotiating. I wanted it on my own sites.&lt;/p&gt;

&lt;p&gt;All of them deploy with &lt;a href="https://kamal-deploy.org" rel="noopener noreferrer"&gt;&lt;strong&gt;Kamal&lt;/strong&gt;&lt;/a&gt;, which fronts each app with &lt;code&gt;kamal-proxy&lt;/code&gt;. The good news: kamal-proxy already speaks HTTP/3 — it has an &lt;code&gt;--http3&lt;/code&gt; flag. The bad news: Kamal gave me no way to turn it on.&lt;/p&gt;

&lt;p&gt;Two things were missing, and the second is the subtle one:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Kamal never passes &lt;code&gt;--http3&lt;/code&gt; to the proxy.&lt;/li&gt;
&lt;li&gt;The proxy container only publishes TCP &lt;strong&gt;80&lt;/strong&gt; and &lt;strong&gt;443&lt;/strong&gt;. HTTP/3 runs over &lt;strong&gt;QUIC, which is UDP&lt;/strong&gt; — so even with the flag set, the UDP 443 listener would sit there unreachable.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Someone had already filed &lt;a href="https://github.com/basecamp/kamal/issues/1842" rel="noopener noreferrer"&gt;a feature request&lt;/a&gt;, so I wasn't alone in wanting this. I forked Kamal and added a &lt;code&gt;proxy.run.http3&lt;/code&gt; option that does both halves of the job: it passes &lt;code&gt;--http3&lt;/code&gt; to &lt;code&gt;kamal-proxy run&lt;/code&gt;, and it publishes the HTTPS port over UDP as well (&lt;code&gt;443:443/udp&lt;/code&gt;). There's a guard, too — you can't enable HTTP/3 when ports aren't published, since there'd be nothing to listen on.&lt;/p&gt;

&lt;p&gt;Turning it on is one line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# config/deploy.yml&lt;/span&gt;
&lt;span class="na"&gt;proxy&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;http3&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Until the &lt;a href="https://github.com/basecamp/kamal/pull/1894" rel="noopener noreferrer"&gt;PR&lt;/a&gt; lands, the Gemfile points at the fork:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;gem&lt;/span&gt; &lt;span class="s2"&gt;"kamal"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;github: &lt;/span&gt;&lt;span class="s2"&gt;"tonic20/kamal"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;branch: &lt;/span&gt;&lt;span class="s2"&gt;"proxy-http3"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;require: &lt;/span&gt;&lt;span class="kp"&gt;false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I shipped it on &lt;a href="https://www.watchbrandindex.com" rel="noopener noreferrer"&gt;watchbrandindex.com&lt;/a&gt; and &lt;a href="https://savearoundtrip.com/?d=watchbrandindex.com" rel="noopener noreferrer"&gt;confirmed the negotiation&lt;/a&gt; — browser and proxy now agree on h3.&lt;/p&gt;

&lt;p&gt;Now to see if DHH merges it upstream. 🤞&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;P.S.&lt;/strong&gt; — While running other sites through that checker, it flagged this one too. This blog isn't on Kamal; it's a static site on S3 + CloudFront, which already serves HTTP/3. But browsers were discovering it the slow way: connect over h2, read the &lt;code&gt;Alt-Svc&lt;/code&gt; header, &lt;em&gt;then&lt;/em&gt; upgrade to h3 on a later connection. The fix here lives in DNS, not the server — an &lt;a href="https://www.rfc-editor.org/rfc/rfc9460" rel="noopener noreferrer"&gt;&lt;code&gt;HTTPS&lt;/code&gt; resource record&lt;/a&gt; (RFC 9460) at the apex:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kopylov.net.  HTTPS  1 . alpn="h3,h2"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now browsers learn h3 is available &lt;em&gt;during&lt;/em&gt; the DNS lookup and try QUIC on the very first connection. One more round trip saved, no server involved.&lt;/p&gt;

</description>
      <category>http3</category>
      <category>kamal</category>
      <category>rails</category>
    </item>
  </channel>
</rss>
