2022-01-07 22:09:52 -05:00
|
|
|
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
|
2021-07-12 12:44:49 +02:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
((window) => {
|
|
|
|
const core = window.__bootstrap.core;
|
2022-08-11 16:56:56 +03:00
|
|
|
const ops = core.ops;
|
2021-07-12 12:44:49 +02:00
|
|
|
const { HttpConn } = window.__bootstrap.http;
|
|
|
|
|
|
|
|
function serveHttp(conn) {
|
2022-08-11 16:56:56 +03:00
|
|
|
const rid = ops.op_http_start(conn.rid);
|
2022-03-16 14:54:18 +01:00
|
|
|
return new HttpConn(rid, conn.remoteAddr, conn.localAddr);
|
2021-07-12 12:44:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
window.__bootstrap.http.serveHttp = serveHttp;
|
|
|
|
})(globalThis);
|