More recently, http-over-quic has been officially named HTTP/3. The biggest change is that the underlying protocol will use UDP instead of TCP. The benefits are lower latency, better congestion control, more accurate RTT time, more efficient multiplexing… Long live Google, the existing HTTP /2(SPDY) protocol is also from Google.

With all the benefits, what are you waiting for? Do it.

Boxopened is based on nodeJS and provides services via nginx reverse generation. Previously, BoxOpened supports HTTP /2, but nginx does not support QUIC yet, so we have to find another way. After a bit of Googling (thanks again, great Google), Caddy was discovered, a new generation of Web servers. Caddy’s website: caddyserver.com/ Caddy claims to be a more user-friendly Web server than Nginx, based on go language development, easy to use configuration, native HTTP /2 support, automatic HTTPS certificate management….

There are many ways to deploy caddy. Since BoxOpened is a Docker-based deployment, caddy is also a Docker-based deployment. Luckily, a Docker image is available (thumbs up for Caddy). Next is the configuration, the official document written simple and clear, a look to understand. Quic support is still experimental, so to enable quIC, add the -quic flag.

The following is the configuration of caddy service in docker-comemage. yml for your reference.

Volumes: -80:80-443:443-80:80 / udp-443:443 /udp volumes: -.. /.. /boxopened-config/caddy/www:/srv - .. /.. /boxopened-config/caddy/ssl:/root/.caddy - .. /.. /boxopened-config/caddy/logs:/wwwlogs - .. /.. /boxopened-config/caddy/conf/Caddyfile:/etc/Caddyfilecommand: ["--conf"."/etc/Caddyfile"."--log"."stdout"."--agree"."--quic"]
Copy the code

Caddyfile configuration

http://boxopened.com {
  redir 301 {
  	/ https://www.boxopened.com{uri}
  }
}

http://www.boxopened.com {
  redir 301 {
  	/ https://{host}{uri}
  }
}

https://www.boxopened.com {
  gzip
  log /wwwlogs/portal.access.log
  tls /root/.caddy/fullchain.pem /root/.caddy/privkey.pem
  proxy / portal:6001 {
  transparent
  }
}
Copy the code

So a few lines of configuration, over the thing, simple!

First of all, the bottom of the QUIC protocol is based on UDP protocol, so when the docker port configuration, to expose the corresponding UDP port, and open the host firewall configuration… (Can I say I’m here until 3:00 am…)

When everything was done, I thought EVERYTHING was ok, but I couldn’t get a QuIC connection. Chrome only supports the latest quic protocol, so I updated the caddy version.

And just to show you what it looks like

For a more intuitive feel, check out boxOpened.com