tauri-apps/tauri-invoke-http

Removed custom-protocol feature but tauri://localhost is still used

elanzini opened this issue · 2 comments

Context

I recently opened this discussion.
It sounded like this could fix my issues, since in my case I want the requests to have as Origin http://localhost.

What I tried

In my Cargo.toml, I removed the custom-protocol from the default features.

Before:

[features]
default = [ "custom-protocol" ]
custom-protocol = [ "tauri/custom-protocol" ]

After:

[features]
default = [ ]
custom-protocol = [ "tauri/custom-protocol" ]

And I have included the dependency as follows (also tried with branch release):

[dependencies]
tauri-invoke-http = { git = "https://github.com/tauri-apps/tauri-invoke-http", branch = "dev" }

But when I run npm run tauri build, the requests still have tauri://localhost as their Origin.
Am I doing something wrong?
Do I need to build with a specific flag?

I think you're looking for https://github.com/tauri-apps/tauri-plugin-localhost. tauri-invoke-http is just for changing the IPC, not the page origin.

Also, removing it from the default features, doesn't change anything. actually disabling the custom-protocol feature would effectively just tell tauri to use the devPath instead of distDir (which doesn't work because there is no localhost server).

Thanks again @FabianLars 🍻 - I have tried integrating the plugin you pointed to and ran into an issue - opened a ticket in the repository directly: tauri-apps/plugins-workspace#155

Sorry for the confusion and thanks for the explanation - my knowledge is quite limited in this context - will close this issue.