Skip to content

Instantly share code, notes, and snippets.

@TimothyGu TimothyGu/index.js
Created Jul 11, 2018

What would you like to do?
Firefox #1475000
"use strict";
const http = require("http");
const server = http.createServer((req, res) => {
if (req.url.includes("slow.js")) {
setTimeout(() => {
res.setHeader("Content-Type", "text/javascript");
res.end("void 0;");
}, 5000);
} else {
res.statusCode = 404;
res.setHeader("Content-Type", "text/plain");
res.end("Not found");
<p>This should get erased.</p>
<button onclick=";"></button>
<script src="http://localhost:8888/slow.js"></script>
alert("You were too slow! Hit stop before this message.");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.