tauri-apps / tauri-invoke-http Goto Github PK
View Code? Open in Web Editor NEWA custom invoke system for Tauri that leverages a localhost server
License: Apache License 2.0
A custom invoke system for Tauri that leverages a localhost server
License: Apache License 2.0
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates are pending. To force PRs open, click the checkbox below.
Cargo.toml
tauri 1
tiny_http 0.12
portpicker 0.1
serde_json 1.0
.github/workflows/audit.yml
actions/checkout v4
rustsec/audit-check v1
.github/workflows/covector-status.yml
actions/checkout v4
.github/workflows/covector-version-or-publish.yml
actions/checkout v4
actions/setup-node v3
tauri-apps/create-pull-request v3
.github/workflows/format.yml
actions/checkout v4
.github/workflows/lint.yml
actions/checkout v4
Swatinem/rust-cache v2
.github/workflows/test.yml
actions/checkout v4
Swatinem/rust-cache v2
safemem is unmaintained
Details | |
---|---|
Status | unmaintained |
Package | safemem |
Version | 0.3.3 |
URL | https://github.com/abonander/safemem |
Date | 2023-02-14 |
The latest crates.io release was in 2019. The repository has been archived by the author.
See advisory page for additional details.
ansi_term is Unmaintained
Details | |
---|---|
Status | unmaintained |
Package | ansi_term |
Version | 0.12.1 |
URL | ogham/rust-ansi-term#72 |
Date | 2021-08-18 |
The maintainer has adviced this crate is deprecated and will not
receive any maintenance.
The crate does not seem to have much dependencies and may or may not be ok to use as-is.
Last release seems to have been three years ago.
The below list has not been vetted in any way and may or may not contain alternatives;
See advisory page for additional details.
Access to XMLHttpRequest at 'http://localhost:23486/main' from origin 'http://localhost:1420' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Basically this crate is not compatible with tauri 2.0
I tried to fix what I could in my fork, but I am not qualified enough to migrate this crate to 2.0 fully.
Please help
xml-rs is Unmaintained
Details | |
---|---|
Status | unmaintained |
Package | xml-rs |
Version | 0.8.4 |
URL | https://github.com/netvl/xml-rs/issues |
Date | 2022-01-26 |
xml-rs is a XML parser has open issues around parsing including integer
overflows / panics that may or may not be an issue with untrusted data.
Together with these open issues with Unmaintained status xml-rs
may or may not be suited to parse untrusted data.
See advisory page for additional details.
kuchiki
is unmaintained
Details | |
---|---|
Status | unmaintained |
Package | kuchiki |
Version | 0.8.1 |
URL | kuchiki-rs/kuchiki@f92e4c0 |
Date | 2023-01-21 |
The kuchiki
repo was marked as archived in this commit.
Possible alternatives may include:
See advisory page for additional details.
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
.
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?
Cool idea. I couldn't get it to work.
Could you help?
Error: Couldn't connect to server
Can't shake hands
Thanks for listening
Tauri config
{
"$schema": "../node_modules/@tauri-apps/cli/schema.json",
"build": {
"beforeBuildCommand": "npm run build",
"beforeDevCommand": "npm run dev",
"devPath": "http://localhost:3000",
"distDir": "../.output/public",
"withGlobalTauri": true
},
"package": {
"productName": "royal",
"version": "0.1.0"
},
"tauri": {
"allowlist": {
"all": true
},
"bundle": {
"active": true,
"category": "DeveloperTool",
"copyright": "",
"deb": {
"depends": []
},
"externalBin": [],
"icon": [
"icons/32x32.png",
"icons/128x128.png",
"icons/[email protected]",
"icons/icon.icns",
"icons/icon.ico"
],
"identifier": "royal.custom.bundleid",
"longDescription": "",
"macOS": {
"entitlements": null,
"exceptionDomain": "",
"frameworks": [],
"providerShortName": null,
"signingIdentity": null
},
"resources": [],
"shortDescription": "",
"targets": "all",
"windows": {
"certificateThumbprint": null,
"digestAlgorithm": "sha256",
"timestampUrl": ""
}
},
"security": {
"csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'"
},
"updater": {
"active": false
},
"windows": [
{
"fullscreen": false,
"height": 600,
"resizable": true,
"title": "Royal",
"width": 800
}
]
}
}
Cargo
[package]
name = "app"
version = "0.1.0"
description = "A Tauri App"
authors = ["you"]
license = ""
repository = ""
default-run = "app"
edition = "2021"
rust-version = "1.62.1"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[build-dependencies]
tauri-build = { version = "1.0.4", features = [] }
[dependencies]
serde_json = "1.0"
tauri-invoke-http = { git = "https://github.com/tauri-apps/tauri-invoke-http", branch = "dev" }
serde = { version = "1.0.140", features = ["derive"] }
tauri = { version = "1.0.5", features = ["api-all"] }
[features]
# by default Tauri runs in production mode
# when `tauri dev` runs it is executed with `cargo run --no-default-features` if `devPath` is an URL
default = [ "custom-protocol" ]
# this feature is used used for production builds where `devPath` points to the filesystem
# DO NOT remove this
custom-protocol = [ "tauri/custom-protocol" ]
Main
#![cfg_attr(
all(not(debug_assertions), target_os = "windows"),
windows_subsystem = "windows"
)]
#[tauri::command]
fn my_command(args: u64) -> Result<String, ()> {
println!("executed command with args {:?}", args);
Ok("executed".into())
}
fn main() {
let http = tauri_invoke_http::Invoke::new(["tauri://localhost", "http://localhost:8080"]);
tauri::Builder::default()
.invoke_system(http.initialization_script(), http.responder())
.setup(move |app| {
http.start(app.handle());
Ok(())
})
.invoke_handler(tauri::generate_handler![my_command])
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
javascript
<script setup>
import { invoke } from '@tauri-apps/api/tauri'
invoke('my_command', { args: 5 }).then(data => {
console.log(data)
}).catch(error => {
console.log(error)
})
</script>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.