Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTPS issue when using Cloudflare Tunnel due to fixed HTTP protocol in axiosInstance #1842

Open
diazmateus opened this issue May 30, 2024 · 0 comments

Comments

@diazmateus
Copy link

When creating a tunnel with Cloudflare to expose my Umbrel instance, the tunnel creation works without problems. However, when using HTTPS, I face issues accessing the new URL. Since I am using HTTPS, all requests must be executed with HTTPS; otherwise, the browser blocks requests made via HTTP.

Identified Cause:
After investigating and debugging the system, I realized that the issue occurs because, in the file /containers/app-proxy/utils/manager.js, where axios is instantiated, the HTTP protocol is being used as a fixed value instead of reading the variable from the constants defined in the const.js file.

Relevant Code:
The code snippet where the issue occurs is as follows:

const CONSTANTS = require('./const.js');

const axiosInstance = axios.create({
    baseURL: `http://${CONSTANTS.MANAGER_IP}:${CONSTANTS.MANAGER_PORT}`,
    headers: {
        common: {
            "User-Agent": `${package.name}/${package.version}`
        }
    }
});

The issue is in the line:

baseURL: `http://${CONSTANTS.MANAGER_IP}:${CONSTANTS.MANAGER_PORT}`

As a suggestion to resolve the issue, the line could be modified to:

baseURL: `${CONSTANTS.APP_PROTOCOL}://${CONSTANTS.MANAGER_IP}:${CONSTANTS.MANAGER_PORT}`

I have submitted a pull request with the requested change: #1841.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant