Skip to content

Instantly share code, notes, and snippets.

@CBenni
Created Dec 11, 2016
Embed
What would you like to do?
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