2024-01-01 14:58:21 -05:00
|
|
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2024-01-26 14:04:07 -05:00
|
|
|
import { core, internals } from "ext:core/mod.js";
|
2024-01-26 17:46:46 -05:00
|
|
|
import { op_http_start } from "ext:core/ops";
|
2024-01-26 14:04:07 -05:00
|
|
|
const { internalRidSymbol } = core;
|
2024-01-10 17:37:25 -05:00
|
|
|
|
2023-03-08 06:44:54 -05:00
|
|
|
import { HttpConn } from "ext:deno_http/01_http.js";
|
2021-07-12 06:44:49 -04:00
|
|
|
|
2023-02-07 14:22:46 -05:00
|
|
|
function serveHttp(conn) {
|
2024-01-22 22:24:03 -05:00
|
|
|
internals.warnOnDeprecatedApi(
|
|
|
|
"Deno.serveHttp()",
|
|
|
|
new Error().stack,
|
|
|
|
"Use `Deno.serve()` instead.",
|
|
|
|
);
|
2024-01-26 14:04:07 -05:00
|
|
|
const rid = op_http_start(conn[internalRidSymbol]);
|
2023-02-07 14:22:46 -05:00
|
|
|
return new HttpConn(rid, conn.remoteAddr, conn.localAddr);
|
|
|
|
}
|
2021-07-12 06:44:49 -04:00
|
|
|
|
2023-02-07 14:22:46 -05:00
|
|
|
export { serveHttp };
|