From c5270abad7c42968dcbdbc8d9f09d7675fb843e9 Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Wed, 16 Mar 2022 14:54:18 +0100 Subject: feat(unstable): Add Deno.upgradeHttp API (#13618) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit adds "Deno.upgradeHttp" API, which allows to "hijack" connection and switch protocols, to eg. implement WebSocket required for Node compat. Co-authored-by: crowlkats Co-authored-by: Ryan Dahl Co-authored-by: Bartek IwaƄczuk --- ext/http/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ext/http/lib.rs') diff --git a/ext/http/lib.rs b/ext/http/lib.rs index 535f52a6c..48a58067e 100644 --- a/ext/http/lib.rs +++ b/ext/http/lib.rs @@ -289,9 +289,9 @@ impl HttpAcceptor { } /// A resource representing a single HTTP request/response stream. -struct HttpStreamResource { +pub struct HttpStreamResource { conn: Rc, - rd: AsyncRefCell, + pub rd: AsyncRefCell, wr: AsyncRefCell, accept_encoding: RefCell, cancel_handle: CancelHandle, @@ -324,7 +324,7 @@ impl Resource for HttpStreamResource { } /// The read half of an HTTP stream. -enum HttpRequestReader { +pub enum HttpRequestReader { Headers(Request), Body(Peekable), Closed, -- cgit v1.2.3