From b8540f0891443f37a110c087dfcc4ff975e2aab8 Mon Sep 17 00:00:00 2001 From: SpikeHD Date: Sat, 11 Jun 2022 15:48:33 -0700 Subject: [PATCH] remove protocol enforcement --- src-tauri/src/proxy.rs | 8 ++++---- src/index.tsx | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src-tauri/src/proxy.rs b/src-tauri/src/proxy.rs index 164e001..e8715c2 100644 --- a/src-tauri/src/proxy.rs +++ b/src-tauri/src/proxy.rs @@ -4,7 +4,7 @@ */ use lazy_static::lazy_static; -use std::sync::Mutex; +use std::{sync::Mutex, str::FromStr}; use rcgen::*; use hudsucker::{ @@ -30,7 +30,7 @@ async fn shutdown_signal() { // Global ver for getting server address. lazy_static! { static ref SERVER: Mutex = { - let m = "localhost:443".to_string(); + let m = "http://localhost:443".to_string(); Mutex::new(m) }; } @@ -56,9 +56,9 @@ impl HttpHandler for ProxyHandler { // Only switch up if request is to the game servers. if uri.contains("hoyoverse.com") || uri.contains("mihoyo.com") || uri.contains("yuanshen.com") { // Create new URI. - let uri = format!("https://{}{}", SERVER.lock().unwrap(), uri_path).parse::().unwrap(); + let new_uri = Uri::from_str(format!("{}{}", SERVER.lock().unwrap(), uri_path).as_str()).unwrap(); // Set request URI to the new one. - *request.uri_mut() = uri; + *request.uri_mut() = new_uri; } RequestOrResponse::Request(request) diff --git a/src/index.tsx b/src/index.tsx index c43546b..b3071ac 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -3,7 +3,7 @@ import ReactDOM from 'react-dom/client' import './index.css' import App from './ui/App' -// import Test from './ui/Test' +import Test from './ui/Debug' const root = ReactDOM.createRoot( document.getElementById('root') as HTMLElement @@ -11,8 +11,8 @@ const root = ReactDOM.createRoot( root.render( - - {/**/} + {/* */} + )