WebSockets & SSE Through Reverse Proxies Explained
Keep long-lived wss:// WebSocket connections and AI token Server-Sent Events (SSE) streaming cleanly over HTTPS.
Exact DNS wire fields: HOST identifies the label, TYPE picks the record format, TTL sets cache duration, TARGET holds the answer.
1. Engineering Breakdown
WebSockets start with an HTTP/1.1 Upgrade handshake over wss://. LLM streams usually use SSE over HTTP/2. In Nginx, enable HTTP 1.1, pass Upgrade headers, and set proxy_buffering off.
Common Pitfalls
- Default Nginx
proxy_read_timeoutis 60s — send periodic WebSocket ping frames or SSE comment heartbeats (: ping\n\n).
2. Interactive DNS Record Syntax Validator
Edit the record type, host label, or value below to validate syntax and build your CLI command.
3. Exact CLI, curl & MCP JSON-RPC Payloads
Pick your preferred interface below and copy the working payload.
agentdomains record ws-app --type A --content 203.0.113.10
curl -N https://ws-app.makes.fyi/events
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "add_dns_record",
"arguments": {
"label": "ws-app",
"type": "A",
"content": "203.0.113.10"
}
}
}
Frequently asked questions
What is WebSockets & SSE Proxying?
Keep long-lived wss:// WebSocket connections and AI token Server-Sent Events (SSE) streaming cleanly over HTTPS.
How do I automate WebSockets & SSE Through Reverse Proxies with AgentDomains?
Use the Go CLI snippet above, send a REST curl call, or invoke add_dns_record on https://mcp.agentdomains.co.
Related DNS & SSL Guides
Reverse Proxy vs URL Forwarding
Reverse proxy (set_proxy) serves your origin under your domain with HTTPS. URL forwarding (set_forward) sends a 301 or 302 redirect.
301 vs 302 HTTP Redirects
302 is temporary and easy to change (our default). 301 is permanent and browsers cache it hard.
Edge RoutingCloudflare Edge TLS & HTTPS
See how set_proxy handles TLS 1.3 at the edge and forwards traffic to your origin hostname.
CORS Behind a Reverse Proxy
Configure Access-Control-Allow-Origin and OPTIONS preflight handling cleanly when your API sits behind an edge reverse proxy.
Claim your agent domain now
Start with 10 free HTTPS domains under agentdomains.co or makes.fyi for 30 days. Upgrade to Pro for $10/year to keep up to 100 names with visitor stats.