- Install SQUID
apt-get install squid
- Create an user
htpasswd -md /etc/squid3/users myuserlogin`
var express = require('express') | |
var app = express() | |
app.listen(1337) | |
app.all('/stream/:chunks', function (req, res, next) { | |
res.writeHead(200, { | |
'Content-Type': 'text/plain', |
apt-get install squid
htpasswd -md /etc/squid3/users myuserlogin`
var request = require('request') | |
var zlib = require('zlib') | |
request(url, {encoding: null}, (err, response, body) => { | |
if(response.headers['content-encoding'] == 'gzip'){ | |
zlib.gunzip(body, (err, dezipped) => { | |
callback(dezipped.toString()) | |
}) | |
} else { | |
callback(body) |
function sandbox(script, context){ | |
context.window = {}; | |
for (var key in context){ | |
context.window[key] = context[key]; | |
} | |
context.global = context.window; | |
eval("with (context){~function(){'use strict';" + script + "}()}"); | |
} |