Start on proxy

This commit is contained in:
KingRainbow44 2022-05-08 22:48:46 -04:00
parent bc3f26eb96
commit 766e01647e
No known key found for this signature in database
GPG Key ID: FC2CB64B00D257BE
5 changed files with 52 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"short_name": "Cultivation",
"name": "Cultivation",
"icons": [
{
"src": "favicon.ico",

13
src-tauri/Cargo.lock generated
View File

@ -622,10 +622,14 @@ name = "cultivation"
version = "0.1.0"
dependencies = [
"hudsucker",
"rustls-pemfile",
"serde",
"serde_json",
"tauri",
"tauri-build",
"tokio-rustls",
"tokio-tungstenite",
"tracing",
]
[[package]]
@ -2698,6 +2702,15 @@ dependencies = [
"webpki",
]
[[package]]
name = "rustls-pemfile"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e7522c9de787ff061458fe9a829dc790a3f5b22dc571694fc5883f448b94d9a9"
dependencies = [
"base64",
]
[[package]]
name = "rustversion"
version = "1.0.6"

View File

@ -18,7 +18,12 @@ tauri-build = { version = "1.0.0-rc.8", features = [] }
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
tauri = { version = "1.0.0-rc.9", features = ["dialog-all", "fs-create-dir", "fs-read-dir", "fs-read-file", "fs-write-file", "path-all"] }
hudsucker = "0.17.2"
tracing = "0.1.34"
tokio-rustls = "0.23.4"
tokio-tungstenite = "0.17.1"
rustls-pemfile = "1.0.0"
[features]
# by default Tauri runs in production mode

View File

@ -3,8 +3,19 @@
windows_subsystem = "windows"
)]
mod proxy;
use tauri::{
command
};
fn main() {
tauri::Builder::default()
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
#[tauri::command]
fn connect() {
}

21
src-tauri/src/proxy.rs Normal file
View File

@ -0,0 +1,21 @@
/*
* Built on example code from:
* https://github.com/omjadas/hudsucker/blob/main/examples/log.rs
*/
use hudsucker::{
async_trait::async_trait,
certificate_authority::RcgenAuthority,
hyper::{Body, Request, Response},
*,
};
use std::net::SocketAddr;
use tracing::*;
use tokio_tungstenite::tungstenite::Message;
/**
* Starts an HTTP(S) proxy server.
*/
async fn start_proxy() {
}