mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2025-04-29 14:16:26 -04:00
Implement download
This commit is contained in:
parent
935993e8da
commit
426989350e
@ -1,6 +1,7 @@
|
||||
use std::{borrow::Cow, ops::ControlFlow, sync::Arc};
|
||||
|
||||
use axum::{
|
||||
body::Bytes,
|
||||
extract::{
|
||||
ws::{self, CloseFrame, Message, WebSocket},
|
||||
State, WebSocketUpgrade,
|
||||
@ -25,6 +26,13 @@ pub(crate) async fn auth_data(State(ctx): State<Arc<WsServerContext>>, body: Str
|
||||
ctx.send_event(WsEvent::AuthData(body)).await;
|
||||
}
|
||||
|
||||
pub(crate) struct UpdateGuiPayload {
|
||||
pub(crate) file: String,
|
||||
pub(crate) checksum: String,
|
||||
}
|
||||
|
||||
pub async fn update_gui(State(ctx): State<Arc<WsServerContext>>, body: Bytes) -> impl IntoResponse {}
|
||||
|
||||
pub(crate) async fn ws_handler(ws: WebSocketUpgrade, State(ctx): State<Arc<WsServerContext>>) -> impl IntoResponse {
|
||||
ws.on_upgrade(move |socket| handle_socket(socket, ctx))
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ pub(crate) fn routes(ctx: Arc<WsServerContext>) -> Router {
|
||||
.route("/health", get(handlers::health))
|
||||
.route("/active-gui", post(handlers::active_gui))
|
||||
.route("/auth-data", post(handlers::auth_data))
|
||||
.route("/update-gui", post(handlers::update_gui))
|
||||
.route("/ws", get(handlers::ws_handler))
|
||||
.with_state(ctx)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user