Mirroring cloudflared trycloudflare.com behavior in Zero Trust tunnel

Hi. I am using cloudflared for local development of a Discord activity. Discord proxies requests in its iframe through discord to a mapping defined by myself. I have the mapping set so all routes go to my cloudflare zero trust tunnel. The Public Hostname set up for that tunnel is http://localhost:8793. When used in discord, there are cryptic errors that seem unrelated to networking. BUT when I use cloudflared tunnel --url http://localhost:8793 instead of the tunnel I created in the Zero Trust UI, I don't have any issues. Are there some settings I need to change to make this permanent tunnel function the same as the cloudflared tunnel command's?
1 Reply
Cooper
CooperOP2mo ago
The error is this
Uncaught Error: @vitejs/plugin-react can't detect preamble. Something is wrong. See https://github.com/vitejs/vite-plugin-react/pull/11#discussion_r430879201
at App.tsx:6:11
Uncaught Error: @vitejs/plugin-react can't detect preamble. Something is wrong. See https://github.com/vitejs/vite-plugin-react/pull/11#discussion_r430879201
at App.tsx:6:11
Again, this ONLY happens when using the tunnel from the zero trust UI. cloudflared tunnel works perfectly fine. I can see one difference is that I get this error in browser (not discord) when running via the tunnel created on the CF UI
None of the “sha512” hashes in the integrity attribute match the content of the subresource. The computed hash is “z4PhNX7vuL3xVChQ1m2AB9Yg5AULVxXcg/SpIdNs6c5H0NE8XYXysP+DGNKHfuwvY7kxvUdBeoGlODJ6+SfaPg==”.
None of the “sha512” hashes in the integrity attribute match the content of the subresource. The computed hash is “z4PhNX7vuL3xVChQ1m2AB9Yg5AULVxXcg/SpIdNs6c5H0NE8XYXysP+DGNKHfuwvY7kxvUdBeoGlODJ6+SfaPg==”.
Well I'll leave this here in case it can help anyone else. Given the hash error, I just started messing with the optimization settings in CF. I disabled Rocket Loader and minification (which is deprecated apparently anyways). I think disabling Rocket Loader is what did the trick for me and allowed this to start working.
Want results from more Discord servers?
Add your server