18 lines
413 B
Dart
18 lines
413 B
Dart
const listener = Deno.listenTls({
|
|
port: 443,
|
|
certFile: "./cert.pem",
|
|
keyFile: "./key.pem",
|
|
alpnProtocols: ["h2", "http/1.1"],
|
|
});
|
|
|
|
for await (const conn of listener) {
|
|
handleConn(conn);
|
|
}
|
|
|
|
async function handleConn(conn: Deno.Conn) {
|
|
const httpConn = Deno.serveHttp(conn);
|
|
for await (const { request, respondWith } of httpConn) {
|
|
respondWith(new Response(`Responding to ${request.url}`));
|
|
}
|
|
}
|