Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
child.exec('sed "s/PLACEHOLDER/' + domain + '/g; s/USERPLACE/screenshare/g; s/PASSPLACE/'+httpPassword+'/g" html/template.js > html/screenShare.plugin.js', (err, stdout, out) => {
if (err) {
throw new Error(err)
}
})
const bot = new Discord.Client({
token: token,
autorun: true
})
const wssServer = primus.createServer({
port: 8006,
iknowhttpsisbetter: true,
pathname: '/ssws'
})
wssServer.save(__dirname + '/html/primus.js')
wssServer.on('connection', spark => {
console.log('Got connection')
fs.readFile('html/screenShare.plugin.js', 'utf8', (err, localPlugin) => {
let localHash = crypto.createHash('sha256').update(localPlugin).digest('hex')
if (localHash != spark.query.version) {
spark.write({ type: 'update', file: localPlugin })
}
if (share) {
spark.write({ type: 'startView', guild: guild })
gulp.task('primus', function() {
var Primus = require('primus');
var Emitter = require('primus-emitter');
var primus = Primus.createServer(function connection(spark) {
}, { port: 3000, transformer: 'websockets' });
primus.use('emitter', Emitter);
var str = primus.library();
return file('primus.js', str, { src: true }).pipe(gulp.dest('lib'));
})