Multipath TCP (MPTCP) for DiscourseHub and iOS Safari PWA behind Caddy

סיכום מבוסס בינה מלאכותית

This discussion explores the feasibility of using Multipath TCP (MPTCP) to improve connection continuity for iOS users accessing a self-hosted Discourse instance via Caddy. Ethsim2 outlines a setup where Caddy v2.11.4 runs in Docker on an Ubuntu host with MPTCP enabled, proxying traffic to Discourse’s nginx. The user seeks clarification on whether iOS clients—specifically the DiscourseHub app, Safari, or installed PWAs—can natively leverage MPTCP for seamless handover between Wi-Fi and cellular networks, noting that while Caddy supports MPTCP, WKWebView does not expose explicit configuration options.

Key questions raised include:

  1. Client Capability: Whether DiscourseHub or Safari/PWA interfaces can request MPTCP or benefit from it transparently.
  2. Docker Compatibility: If Docker’s bridge/NAT networking preserves MPTCP subflows or forces fallback to standard TCP.
  3. Protocol Comparison: How HTTP/3 over QUIC compares to HTTP/2 over MPTCP regarding connection migration and continuity.
  4. Recovery Mechanisms: Existing Discourse or client-side methods for recovering interrupted requests during network changes.

In a follow-up post, Ethsim2 describes a practical incident where the post editor became stuck in a “Saving” state on an iPhone 16 Pro running a Safari PWA. Log analysis revealed that while Caddy received the full request body via HTTP/3, nginx returned HTTP 400 errors, resulting in data loss when the user manually switched from Wi-Fi to cellular. This incident highlights two specific concerns: determining if QUIC connection migration was attempted by the iOS browser, and whether Discourse’s composer has adequate timeout or recovery mechanisms to preserve unsaved text when network connections stall.

Continuing the discussion from Caddy in front of app’s Nginx via Docker Compose:

Following my earlier discussion about running Caddy in front of Discourse’s nginx container to provide HTTP/3 and QUIC 0-RTT, I’ve been looking into a separate but related question: whether Multipath TCP (MPTCP) could improve connection continuity for iOS users moving between Wi-Fi and cellular networks.

My earlier work was primarily concerned with initial page-loading performance. This question is different: I regularly access my private Discourse study archive while moving between activities, and interrupted connections or buffering can delay access to important information.

Why I’m asking

In some locations, Wi-Fi is reliable while cellular reception is poor; elsewhere, the situation is reversed.

Ordinary iOS network switching has not always provided the continuity I need. I already use separate network bonding/failover technology for connection resilience, but I’m interested in understanding whether some of that continuity could be achieved natively between an iOS client and my Discourse server.

In particular, I’m interested in connection handover and avoiding stalled requests, rather than necessarily aggregating the bandwidth of two connections.

What I’ve found so far

The Linux MPTCP compatibility documentation lists Caddy v2.10.0 onwards as supporting MPTCP by default, subject to operating-system support.

Apple’s MPTCP documentation describes how applications can opt into MPTCP through URLSessionConfiguration.

However, I also found an Apple Developer Forums explanation indicating that WKWebView doesn’t expose an equivalent MPTCP configuration option.

This leaves me uncertain about whether DiscourseHub, Safari or an installed iOS PWA could benefit from MPTCP, particularly when HTTP/3 over QUIC is also available.

Confirmed server environment

I’ve checked the production VPS using read-only commands, without modifying its configuration.

  • Reverse proxy: Caddy v2.11.4, official caddy:2.11.4 Docker image

  • Host: Ubuntu, Linux kernel 6.8.0-146-generic

  • Host MPTCP: net.mptcp.enabled = 1

  • Container MPTCP: /proc/sys/net/mptcp/enabled = 1

  • Docker network: caddy_default, driver bridge, options {}

  • Go environment: GODEBUG unset

  • Published ports: TCP 80, TCP 443 and UDP 443, on IPv4 and IPv6

Discourse’s nginx remains behind Caddy, with Caddy providing the public HTTPS and HTTP/3 endpoint.

These checks suggest that the server has the basic prerequisites for MPTCP support, although I haven’t verified actual MPTCP negotiation through Docker’s published-port forwarding.

Questions

  1. DiscourseHub: Does its iOS networking use components capable of requesting MPTCP, or is its main web content handled through networking APIs that don’t expose this capability?

  2. Safari and installed PWAs: Is there any difference between accessing Discourse through DiscourseHub, Safari and an installed iOS PWA? Does the client have to explicitly request MPTCP, or could any of these access methods benefit transparently?

  3. Docker networking: Can the bridge/NAT configuration preserve the initial MPTCP negotiation and additional subflows, or could this cause connections to fall back to ordinary TCP?

  4. HTTP/3 versus MPTCP: Since HTTP/3 uses QUIC over UDP rather than TCP, would QUIC connection migration provide any comparable continuity when switching networks? Is there a practical distinction between HTTP/2 over MPTCP and HTTP/3 over QUIC in this situation?

  5. Discourse-side recovery: Are there existing mechanisms in Discourse or its iOS clients for recovering interrupted requests when the underlying network changes? Is there a recommended way to establish which transport an iOS client is actually using?

I’m not proposing that Discourse itself should manage multiple network interfaces. I’m trying to understand where responsibility lies between the iOS client, the transport protocol, Docker/Caddy and Discourse, and whether there are existing capabilities I could make use of.

I’d be grateful for any pointers or corrections to my understanding.

Thanks!

Follow-up: interrupted iOS post edit and HTTP/3 connection continuity

I have now encountered a practical example of the connection-continuity problem I was asking about.

On 21 October 2026, while editing a post in my private Discourse instance on an iPhone 16 Pro using the Safari PWA, the blue Saving bar became stuck. I had just dictated some additional lecture notes.

The composer was no longer accessible, including when I touched the blue Saving bar, so I couldn’t copy the unsaved text elsewhere.

After waiting longer than usual, I manually disabled Wi-Fi to try cellular connectivity. The page did not immediately change, but subsequent attempts to navigate also appeared to hang.

I subsequently examined the Caddy and nginx logs and the post’s revision history.

At 12:20:08 BST:

  • Caddy recorded an HTTP/3 PUT /posts/70695 request from the university Wi-Fi connection, with all 1,000 request-body bytes received but status 0.

  • nginx recorded the corresponding request as HTTP 400, with no Discourse route or upstream processing time.

  • Two other iPhone requests originating from the cellular connection also received HTTP 400 at the same second.

  • No successful post revision was recorded at that time.

A subsequent edit succeeded at 12:20:55 BST, but the dictated text was missing.

There was also a successful Discourse draft autosave at 12:19:44 BST, although I cannot establish whether it contained the missing text.

I appreciate that manually disabling Wi-Fi may have interrupted outstanding requests. However, the original Saving operation was already stuck before I changed the network connection.

This raises two questions related to my original post:

  1. QUIC connection migration: Is there a recommended way of determining whether the iOS browser attempted migration of the existing HTTP/3 connection, rather than establishing a new connection or abandoning outstanding requests?

  2. Discourse composer recovery: If a post-edit request becomes stuck or is interrupted, is the composer expected to remain inaccessible behind the Saving state? Is there an existing timeout, retry or recovery mechanism that should preserve the unsaved text?

I’m particularly interested in the second question because I couldn’t return to the editor to copy my work before attempting to restore connectivity.

I haven’t changed any Caddy, nginx or HTTP/3 settings as a result of this incident, since the available evidence doesn’t yet identify what caused the initial Saving operation to stall.