summaryrefslogtreecommitdiff
path: root/ext/http/lib.rs
diff options
context:
space:
mode:
authorBert Belder <bertbelder@gmail.com>2022-03-16 14:54:18 +0100
committerGitHub <noreply@github.com>2022-03-16 14:54:18 +0100
commitc5270abad7c42968dcbdbc8d9f09d7675fb843e9 (patch)
tree7e7ff9b63b7cd3420295d5e546dcd987ed746d7d /ext/http/lib.rs
parent89a41d0a67c531d937126bbdb095ab1edb5eede2 (diff)
feat(unstable): Add Deno.upgradeHttp API (#13618)
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 <crowlkats@toaxl.com> Co-authored-by: Ryan Dahl <ry@tinyclouds.org> Co-authored-by: Bartek IwaƄczuk <biwanczuk@gmail.com>
Diffstat (limited to 'ext/http/lib.rs')
-rw-r--r--ext/http/lib.rs6
1 files changed, 3 insertions, 3 deletions
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<HttpConnResource>,
- rd: AsyncRefCell<HttpRequestReader>,
+ pub rd: AsyncRefCell<HttpRequestReader>,
wr: AsyncRefCell<HttpResponseWriter>,
accept_encoding: RefCell<Encoding>,
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>),
Body(Peekable<Body>),
Closed,