Skip to content

Instantly share code, notes, and snippets.

@CBenni
Created December 11, 2016 04:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CBenni/c61ad1a2928ccf25276c562061d7e74a to your computer and use it in GitHub Desktop.
Save CBenni/c61ad1a2928ccf25276c562061d7e74a to your computer and use it in GitHub Desktop.
var express = require("express");
var app = express();
var server = require('http').Server(app);
server.listen(9003);
app.get("*", function(req, res, next) {
var url = req.path.substr(1);
if(url.startsWith("https://cdn.frankerfacez.com/emoticon/") || url.startsWith("https://cdn.betterttv.net/emote/")) {
console.log("Getting url "+req.path);
require('request').get(url).pipe(res);
} else {
res.status(403).end("403 Forbidden");
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment