HTTP3 not working UDP

I am encountering an issue with my Caddy installation.

caddy version
2943c41884278ec5fc44bcb55d2b9b088838cdc2+modified (24 Apr 23 16:36 UTC)

I have installed the latest release from GitHub using xcaddy and have noticed that HTTP3 does not work for IPv4 and IPv6. When I try to access my website via IPv4 HTTP3 does not work. When I ran the command netstat -tulpn | grep caddy, it printed udp6 but no udp neither say LISTEN. tcp says LISTEN The output of this command is:

tcp        0      0*               LISTEN      4397/caddy          
tcp6       0      0 :::80                   :::*                    LISTEN      4397/caddy          
tcp6       0      0 :::443                  :::*                    LISTEN      4397/caddy          
udp6       0      0 :::443                  :::*                                4397/caddy    

I have already opened the UDP port 443 from Digital Ocean and from Ubuntu UFW, but Caddy does not seem to be listening to UDP. Can you please guide me on how to tell Caddy to listen to UDP (IPv4 /IPv6) as well? My server is hosted on Digital Ocean.

When i do curl it’s not even work for http3

curl -I --http3 https://(domain goes here):443
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0   460    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
HTTP/1.1 200 OK
Alt-Svc: h3=":443"; ma=2592000
Cache-Control: max-age=300
Content-Length: 460
Content-Type: text/html; charset=utf-8
Date: Sun, 30 Apr 2023 21:01:50 GMT
Server: Caddy

Also that when I tried accessing the website via Chrome browser, it would not load via H3 no matter how much I reloaded it.

I appreciate any help you can provide

That’s normal behaviour. UDP doesn’t have the concept of connections, so there’s no such thing as “listening” at the protocol level.

Also, udp6 doesn’t mean it doesn’t support IPv4. It just means that it does support IPv6. AF_INET6 supports both IPv4 and IPv6.

I confirmed by looking at the netstat output on the server, and I see the same thing. And we know that HTTP/3 works there.

I think that build of curl might just not be forcing HTTP/3 support. Try this command instead, which I know works:

docker run -it --rm ymuski/curl-http3 curl -vs -D/dev/stdout -o/dev/null --http3

You’ll need Docker installed obviously, but this does show HTTP/3 support:

> GET / HTTP/3
> Host:
> user-agent: curl/7.88.1-DEV
> accept: */*
< HTTP/3 200 
< content-length: 39108
< server: Caddy
< content-type: text/html; charset=utf-8

Using browsers to test HTTP/3 is not reliable. They typically make a first request using HTTP 1 and 2 over TCP, then when they see Alt-Svc they may choose to try HTTP 3 for subsequent connections. If TCP was fast enough, it usually doesn’t need to try UDP at all anyway.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.