OctoApp-Plugin icon indicating copy to clipboard operation
OctoApp-Plugin copied to clipboard

Send custom headers on WebSocket connections

Open SilentSword123456 opened this issue 1 month ago • 2 comments

Is your feature request related to a problem? Please describe. I'm trying to use OctoApp with my OctoPrint instance that's behind Cloudflare Access (Zero Trust). While OctoApp has the ability to add custom headers, these headers don't appear to be sent consistently across all requests, particularly during WebSocket connections. This prevents me from using Cloudflare Access service tokens for authentication. The custom headers I've configured (CF-Access-Client-Id and CF-Access-Client-Secret) work when testing with curl, but OctoApp still gets blocked by Cloudflare Access with the error: "OctoApp was able to communicate with 3d.silentlab.work, but when trying to establish a HTTP(S) connection an unexpected error occurred."

Describe the solution you'd like I would like OctoApp to consistently send custom headers on all HTTP requests and WebSocket connections throughout the entire session lifecycle. This includes:

Initial connection requests WebSocket upgrade requests All subsequent API calls Streaming/camera feed connections

This would enable seamless integration with Cloudflare Access service tokens and other authentication proxies that rely on custom headers for authorization. Describe alternatives you've considered

Removing Cloudflare Access entirely - This works but removes an additional security layer Using IP-based bypass rules - Not practical for mobile devices with changing IPs Using OctoEverywhere/Obico - Adds another third-party service dependency when I already have Cloudflare tunnels set up Increasing session duration in Cloudflare Access - Still requires periodic browser-based re-authentication, which breaks the mobile app experience

Additional context OctoApp was able to communicate with 3d.silentlab.work, but when trying to establish a HTTP(S) connection an unexpected error occurred. Android reports following issue: Expected response body of the type 'class de.crysxd.octoapp.engine.octoprint. dto.login.OctoUser (Kotlin reflection is not available)' but was 'class io.ktor.utils.io.SourceByteReadChannel (Kotlin reflection is not available)' In response from**(I censored this) Response status 200 Response header ContentType: text/html Request header Accept: application/json You can read how to resolve

NoTransformation FoundException at FAQ: https://ktor.io/docs/faq.html#no -transformation-found-exception** Please make sure that your ** printer URL and port** are correct as the app might connect to something else than your printer, resulting in the above error! You can long-press "Need help?" above to get support (please include logs).

Image

SilentSword123456 avatar Nov 22 '25 17:11 SilentSword123456