Skip to content

Commit adeb05d

Browse files
NathanFlurryMasterPtato
authored andcommitted
chore(pegboard-gateway): add new message id format & add deprecated tunnel ack
1 parent 759df3e commit adeb05d

File tree

50 files changed

+1865
-1190
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1865
-1190
lines changed

Cargo.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

engine/packages/guard-core/src/custom_serve.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ use bytes::Bytes;
44
use http_body_util::Full;
55
use hyper::{Request, Response};
66
use tokio_tungstenite::tungstenite::protocol::frame::CloseFrame;
7-
use uuid::Uuid;
87

98
use crate::WebSocketHandle;
109
use crate::proxy_service::ResponseBody;
1110
use crate::request_context::RequestContext;
1211

12+
use pegboard::tunnel::id::RequestId;
13+
1314
pub enum HibernationResult {
1415
Continue,
1516
Close,
@@ -23,6 +24,7 @@ pub trait CustomServeTrait: Send + Sync {
2324
&self,
2425
req: Request<Full<Bytes>>,
2526
request_context: &mut RequestContext,
27+
request_id: RequestId,
2628
) -> Result<Response<ResponseBody>>;
2729

2830
/// Handle a WebSocket connection after upgrade. Supports connection retries.
@@ -33,7 +35,7 @@ pub trait CustomServeTrait: Send + Sync {
3335
_path: &str,
3436
_request_context: &mut RequestContext,
3537
// Identifies the websocket across retries.
36-
_unique_request_id: Uuid,
38+
_unique_request_id: RequestId,
3739
// True if this websocket is reconnecting after hibernation.
3840
_after_hibernation: bool,
3941
) -> Result<Option<CloseFrame>> {
@@ -44,7 +46,7 @@ pub trait CustomServeTrait: Send + Sync {
4446
async fn handle_websocket_hibernation(
4547
&self,
4648
_websocket: WebSocketHandle,
47-
_unique_request_id: Uuid,
49+
_unique_request_id: RequestId,
4850
) -> Result<HibernationResult> {
4951
bail!("service does not support websocket hibernation");
5052
}

engine/packages/guard-core/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ pub mod websocket_handle;
1212

1313
pub use cert_resolver::CertResolverFn;
1414
pub use custom_serve::CustomServeTrait;
15+
pub use pegboard::tunnel::id::{RequestId, generate_request_id};
1516
pub use proxy_service::{
1617
CacheKeyFn, MiddlewareFn, ProxyService, ProxyState, RouteTarget, RoutingFn, RoutingOutput,
1718
};

0 commit comments

Comments
 (0)