I made a similar thing once to relay UDP traffic over WebSocket and it supports Cloudflare if needed: https://github.com/ameshkov/udptlspipe
The use case is to relay WireGuard over TCP/CF in a restrictive network, confirmed to work in China, obviously not too fast.