diff options
Diffstat (limited to 'ext/http')
-rw-r--r-- | ext/http/README.md | 4 | ||||
-rw-r--r-- | ext/http/lib.deno_http.unstable.d.ts | 53 | ||||
-rw-r--r-- | ext/http/lib.rs | 5 |
3 files changed, 0 insertions, 62 deletions
diff --git a/ext/http/README.md b/ext/http/README.md deleted file mode 100644 index ab557017a..000000000 --- a/ext/http/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# deno_http - -This crate implements server-side HTTP based on primitives from the -[Fetch API](https://fetch.spec.whatwg.org/). diff --git a/ext/http/lib.deno_http.unstable.d.ts b/ext/http/lib.deno_http.unstable.d.ts deleted file mode 100644 index 5c5bf78df..000000000 --- a/ext/http/lib.deno_http.unstable.d.ts +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. - -/// <reference no-default-lib="true" /> -/// <reference lib="esnext" /> - -declare namespace Deno { - export interface WebSocketUpgrade { - response: Response; - socket: WebSocket; - } - - export interface UpgradeWebSocketOptions { - protocol?: string; - } - - /** **UNSTABLE**: new API, yet to be vetted. - * - * Used to upgrade an incoming HTTP request to a WebSocket. - * - * Given a request, returns a pair of WebSocket and Response. The original - * request must be responded to with the returned response for the websocket - * upgrade to be successful. - * - * ```ts - * const conn = await Deno.connect({ port: 80, hostname: "127.0.0.1" }); - * const httpConn = Deno.serveHttp(conn); - * const e = await httpConn.nextRequest(); - * if (e) { - * const { socket, response } = Deno.upgradeWebSocket(e.request); - * socket.onopen = () => { - * socket.send("Hello World!"); - * }; - * socket.onmessage = (e) => { - * console.log(e.data); - * socket.close(); - * }; - * socket.onclose = () => console.log("WebSocket has been closed."); - * socket.onerror = (e) => console.error("WebSocket error:", e.message); - * e.respondWith(response); - * } - * ``` - * - * If the request body is disturbed (read from) before the upgrade is - * completed, upgrading fails. - * - * This operation does not yet consume the request or open the websocket. This - * only happens once the returned response has been passed to `respondWith`. - */ - export function upgradeWebSocket( - request: Request, - options?: UpgradeWebSocketOptions, - ): WebSocketUpgrade; -} diff --git a/ext/http/lib.rs b/ext/http/lib.rs index 8221a6b0d..ba6d73d5c 100644 --- a/ext/http/lib.rs +++ b/ext/http/lib.rs @@ -34,7 +34,6 @@ use std::borrow::Cow; use std::cell::RefCell; use std::future::Future; use std::net::SocketAddr; -use std::path::PathBuf; use std::pin::Pin; use std::rc::Rc; use std::task::Context; @@ -45,10 +44,6 @@ use tokio::io::AsyncWrite; use tokio::sync::oneshot; use tokio_util::io::StreamReader; -pub fn get_unstable_declaration() -> PathBuf { - PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("lib.deno_http.unstable.d.ts") -} - pub fn init() -> Extension { Extension::builder() .js(include_js_files!( |