feat: add url scheme handler for macos

This commit is contained in:
Kingtous
2023-02-04 11:23:36 +08:00
parent a9fc63c34f
commit 4dfae8da10
8 changed files with 116 additions and 31 deletions

View File

@@ -16,10 +16,10 @@ use hbb_common::{
config::{self, Config, Config2},
futures::StreamExt as _,
futures_util::sink::SinkExt,
log, password_security as password, timeout, tokio,
log, password_security as password, ResultType, timeout,
tokio,
tokio::io::{AsyncRead, AsyncWrite},
tokio_util::codec::Framed,
ResultType,
};
use crate::rendezvous_mediator::RendezvousMediator;
@@ -210,6 +210,7 @@ pub enum Data {
DataPortableService(DataPortableService),
SwitchSidesRequest(String),
SwitchSidesBack,
UrlLink(String)
}
#[tokio::main(flavor = "current_thread")]
@@ -832,3 +833,9 @@ pub async fn test_rendezvous_server() -> ResultType<()> {
c.send(&Data::TestRendezvousServer).await?;
Ok(())
}
#[tokio::main(flavor = "current_thread")]
pub async fn send_url_scheme(url: String) -> ResultType<()> {
connect(1_000, "_url").await?.send(&Data::UrlLink(url)).await?;
Ok(())
}