HTTP/3
HTTP/3
HTTP over QUIC. Provides reliability on top of UDP.
HTTP/3
HTTP over QUIC. Provides reliability on top of UDP.
HTTP/3 is the next-generation protocol for web communication, based on the QUIC (Quick UDP Internet Connections) protocol developed by Google. It was officially standardized by the IETF as RFC 9114 in June 2022, and it implements reliability and security on top of UDP to overcome the limitations of HTTP/2's TCP foundation. Currently, more than about 25% of global web traffic uses HTTP/3.
The most innovative feature of HTTP/3 is 0-RTT (Zero Round-Trip Time) connection setup. HTTP/2 required at least 2-RTT for the TCP 3-way handshake + TLS 1.3 handshake, but HTTP/3 reuses previous connection information so that encrypted data can be sent from the first packet. As a result, connection latency is reduced by 100-200ms or more.
Connection Migration is a unique feature of HTTP/3. Because TCP identifies a connection by the combination of IP address and port, the connection drops when a mobile device switches from Wi-Fi to LTE. HTTP/3, on the other hand, uses a Connection ID to keep the existing connection alive even when the network changes. This enables uninterrupted streaming and real-time services in mobile environments.
The Head-of-Line Blocking problem of HTTP/2 has also been completely solved. HTTP/2 supports multiplexing over a single TCP connection, but if one packet was lost, all streams had to wait. In HTTP/3, each stream operates independently, so packet loss on one stream does not affect the others. According to Cloudflare's measurements, on a network with a 2% packet loss rate, HTTP/3 performs about 3 times faster than HTTP/2.
# cURL로 HTTP/3 요청 (cURL 7.66+ with HTTP/3 지원 빌드 필요)
curl --http3 https://cloudflare-quic.com
curl --http3-only https://www.google.com # HTTP/3 강제 사용
# HTTP 버전 확인
curl -I --http3 https://cloudflare.com 2>&1 | grep -i "HTTP"
# HTTP/3 200
# HTTP/3 지원 여부 테스트
curl -sI https://www.cloudflare.com -o /dev/null -w '%{http_version}\n'
# 3 (HTTP/3 지원 시)
# Chrome에서 HTTP/3 확인 (DevTools)
# 1. F12 → Network 탭
# 2. 우클릭 → Protocol 컬럼 추가
# 3. h3 표시되면 HTTP/3 사용 중
# Chrome QUIC 내부 상태 확인
# 주소창에 입력: chrome://net-internals/#quic
# Firefox에서 HTTP/3 활성화 확인
# about:config → network.http.http3.enable = true
# Alt-Svc 헤더로 HTTP/3 지원 확인
curl -sI https://www.cloudflare.com | grep -i "alt-svc"
# alt-svc: h3=":443"; ma=86400
# Nginx HTTP/3 설정 (Nginx 1.25.0+ 또는 nginx-quic 빌드 필요)
# /etc/nginx/nginx.conf
http {
# SSL 인증서 설정 (HTTP/3는 TLS 1.3 필수)
ssl_certificate /etc/nginx/ssl/cert.pem;
ssl_certificate_key /etc/nginx/ssl/key.pem;
ssl_protocols TLSv1.3;
server {
# HTTP/2 + HTTP/3 동시 지원 (권장)
listen 443 ssl;
listen 443 quic reuseport; # HTTP/3 (QUIC)
# IPv6 지원
listen [::]:443 ssl;
listen [::]:443 quic reuseport;
server_name example.com;
# HTTP/3 활성화
http3 on;
# Alt-Svc 헤더 추가 (클라이언트에게 HTTP/3 지원 알림)
add_header Alt-Svc 'h3=":443"; ma=86400' always;
# QUIC 최적화 설정
quic_retry on; # 연결 마이그레이션 지원
ssl_early_data on; # 0-RTT 활성화
# 0-RTT replay attack 방지
proxy_set_header Early-Data $ssl_early_data;
location / {
root /var/www/html;
index index.html;
}
}
}
# 방화벽에서 UDP 443 포트 열기 (필수!)
# sudo ufw allow 443/udp
# sudo iptables -A INPUT -p udp --dport 443 -j ACCEPT
# Python HTTP/3 클라이언트 (aioquic 라이브러리)
# pip install aioquic httpx[http2]
import asyncio
from aioquic.asyncio import connect
from aioquic.asyncio.protocol import QuicConnectionProtocol
from aioquic.quic.configuration import QuicConfiguration
# 기본 HTTP/3 요청
async def http3_request():
configuration = QuicConfiguration(
is_client=True,
alpn_protocols=["h3"], # HTTP/3 ALPN
)
async with connect(
"www.cloudflare.com",
443,
configuration=configuration
) as protocol:
# HTTP/3 스트림으로 요청 전송
reader, writer = await protocol.create_stream()
# ... 요청 처리
print("HTTP/3 연결 성공!")
# httpx로 HTTP/2/3 자동 선택 (더 간단)
import httpx
async def httpx_example():
# HTTP/2 사용 (HTTP/3는 아직 실험적)
async with httpx.AsyncClient(http2=True) as client:
response = await client.get("https://www.cloudflare.com")
print(f"Protocol: {response.http_version}")
print(f"Status: {response.status_code}")
# HTTP/3 지원 확인 함수
async def check_http3_support(domain: str) -> bool:
"""Alt-Svc 헤더로 HTTP/3 지원 여부 확인"""
async with httpx.AsyncClient() as client:
response = await client.head(f"https://{domain}")
alt_svc = response.headers.get("alt-svc", "")
return "h3" in alt_svc
# 실행
if __name__ == "__main__":
asyncio.run(httpx_example())
"Mobile users account for 70% of our traffic, and we have an issue with connections dropping when switching from Wi-Fi to LTE. If we adopt HTTP/3's Connection Migration, we can keep the existing session alive even during network switches, which solves the video streaming interruption problem."
"HTTP/3 uses QUIC instead of TCP to solve the Head-of-Line Blocking problem. In HTTP/2, if packet loss occurs on a single TCP connection, all streams are blocked, but in HTTP/3 each stream is independent, so a loss on one stream does not affect the others. 0-RTT also reduces the initial connection time by 100ms or more."
"Cloudflare and AWS CloudFront already support HTTP/3, so we can enable it right at the front of the CDN. We can keep the backend servers on HTTP/2 and handle HTTP/3 only at the edge, which lets us adopt it without risk."
Take a mock interview on this topic → WIA SOOM AI Interview · Start for free
Because HTTP/3 is UDP-based, you must open UDP port 443 on the firewall. Many corporate networks and some ISPs restrict UDP traffic, so be sure to implement an HTTP/2 fallback.
0-RTT data is vulnerable to replay attacks. Important requests such as payments or state changes must be handled as regular requests rather than 0-RTT. When using ssl_early_data in Nginx, distinguish them with the Early-Data header.
Even if the server supports HTTP/3, without an Alt-Svc header the browser connects only over HTTP/2. Be sure to include the 'Alt-Svc: h3=":443"; ma=86400' header in the response.
Adopt it first through a CDN (Cloudflare, CloudFront), and migrate gradually with Alt-Svc. Keep the HTTP/2 fallback, and use 0-RTT only for idempotent requests such as GET/HEAD. Track the QUIC connection ratio through monitoring.