diff --git a/.gitignore b/.gitignore index 8a8b87b5..5f8b64e5 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ node_modules/ .nyc_output/ .vscode/ examples/*/package-lock.json +.tap diff --git a/examples/blacklist/blacklist.js b/examples/blacklist/blacklist.js index c8290e9e..9cffebb1 100644 --- a/examples/blacklist/blacklist.js +++ b/examples/blacklist/blacklist.js @@ -7,7 +7,7 @@ module.exports = function ({ blockedDomains, message }) { const { hostname } = URL.parse(data.url); return blockedDomains.some( (blockedDomain) => - hostname === blockedDomain || hostname.endsWith(`.${blockedDomain}`) + hostname === blockedDomain || hostname.endsWith(`.${blockedDomain}`), ); } diff --git a/examples/blacklist/server.js b/examples/blacklist/server.js index 1a610d0d..e633b826 100644 --- a/examples/blacklist/server.js +++ b/examples/blacklist/server.js @@ -19,7 +19,7 @@ const unblocker = Unblocker({ app.use(unblocker); app.get("/", (req, res) => - res.redirect("/proxy/https://en.wikipedia.org/wiki/Main_Page") + res.redirect("/proxy/https://en.wikipedia.org/wiki/Main_Page"), ); app.listen(8080).on("upgrade", unblocker.onUpgrade); diff --git a/examples/custom-user-agent/package.json b/examples/custom-user-agent/package.json index 9ee22751..e6fa4832 100644 --- a/examples/custom-user-agent/package.json +++ b/examples/custom-user-agent/package.json @@ -7,7 +7,7 @@ "unblocker": "file:..\\.." }, "engines": { - "node": ">=6" + "node": ">=8" }, "scripts": { "start": "node server.js" diff --git a/examples/custom-user-agent/server.js b/examples/custom-user-agent/server.js index 9fe0143b..174c8eba 100644 --- a/examples/custom-user-agent/server.js +++ b/examples/custom-user-agent/server.js @@ -15,12 +15,12 @@ app.use(unblocker); app.get("/", (req, res) => res.end( - "Use the format http://thissite.com/proxy/http://site-i-want.com/ to access the proxy." - ) + "Use the format http://thissite.com/proxy/http://site-i-want.com/ to access the proxy.", + ), ); app.listen(8080).on("upgrade", unblocker.onUpgrade); console.log( - "app listening on port 8080. Test at http://localhost:8080/proxy/https://duckduckgo.com/?q=what%27s+my+user+agent&atb=v130-1ei&ia=answer" + "app listening on port 8080. Test at http://localhost:8080/proxy/https://duckduckgo.com/?q=what%27s+my+user+agent&atb=v130-1ei&ia=answer", ); diff --git a/examples/express/server.js b/examples/express/server.js index 096529d4..1d2f1a45 100644 --- a/examples/express/server.js +++ b/examples/express/server.js @@ -10,7 +10,7 @@ const unblocker = Unblocker({ app.use(unblocker); app.get("/", (req, res) => - res.redirect("/proxy/https://en.wikipedia.org/wiki/Main_Page") + res.redirect("/proxy/https://en.wikipedia.org/wiki/Main_Page"), ); // start the server and allow unblocker to proxy websockets: diff --git a/examples/replace_snippet/replace_snippet.js b/examples/replace_snippet/replace_snippet.js index 05dbbe79..e4baa681 100644 --- a/examples/replace_snippet/replace_snippet.js +++ b/examples/replace_snippet/replace_snippet.js @@ -18,7 +18,7 @@ module.exports = function (config) { this.push(updated, "utf8"); next(); }, - }) + }), ); } } diff --git a/examples/replace_snippet/server.js b/examples/replace_snippet/server.js index 9cb8ad20..47c27350 100644 --- a/examples/replace_snippet/server.js +++ b/examples/replace_snippet/server.js @@ -12,15 +12,16 @@ app.use( responseMiddleware: [ replaceSnippet({ processContentTypes: ["text/html"], - searchFor: /proxy/https://www.youtube.com/watch?v=dQw4w9WgXcQ to see the magic.' + 'Visit a link such as proxy/https://www.youtube.com/watch?v=dQw4w9WgXcQ to see the magic.', ); } else { res.writeHead(404, headers); diff --git a/examples/youtube/youtube.js b/examples/youtube/youtube.js index d08fdd9a..499bf410 100644 --- a/examples/youtube/youtube.js +++ b/examples/youtube/youtube.js @@ -33,14 +33,14 @@ ${formats (format) => ` ` + .shift()}" src="/proxy/${format.url.replace(/&/g, "&")}">`, ) .join("\n")} ${info.videoDetails.description.replace(/[\n]/g, "\n")}
${info.videoDetails.description.replace(/[\n]/g, "\n")}