Last active
January 27, 2025 05:42
-
-
Save kt3k/7cdd258c23ca439ac7df205079c61cde to your computer and use it in GitHub Desktop.
sock-init-workaround related edge cases. Each script represents independent edge cases around sock-init-workaround
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fetch from "npm:make-fetch-happen"; | |
const resp = await fetch("http://example.com"); | |
console.log(await resp.text()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
deno -A npm:npm-check-updates |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { chromium } from "npm:playwright"; | |
await chromium.launch(); | |
console.log("chromium launched"); | |
Deno.exit(0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
deno -A npm:playwright install chromium |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import WebSocket from "npm:[email protected]"; | |
const key = Deno.readTextFileSync("tests/testdata/tls/localhost.key"); | |
const cert = Deno.readTextFileSync("tests/testdata/tls/localhost.crt"); | |
Deno.serve({ key, cert, port: 0, onListen }, (req) => { | |
const { socket, response } = Deno.upgradeWebSocket(req); | |
socket.addEventListener("open", () => { | |
console.log("open on server"); | |
}); | |
socket.addEventListener("message", () => { | |
console.log("message on server"); | |
Deno.exit(0); | |
}); | |
return response; | |
}); | |
function onListen({ port }) { | |
const socket = new WebSocket(`wss://localhost:${port}`); | |
socket.on("open", () => { | |
console.log("open on client"); | |
socket.send("hi"); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment