Skip to content

Instantly share code, notes, and snippets.

@alanhoff
Created October 31, 2014 19:11
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 alanhoff/e54b3a2893abedb2d741 to your computer and use it in GitHub Desktop.
Save alanhoff/e54b3a2893abedb2d741 to your computer and use it in GitHub Desktop.
// jshint node: true, strict: false
var tls = require('tls');
// Configurações do servidor
var config = {
host: '****',
port: 8080
};
// Dispara se o servidor não conectar em 5 segundos
var timer = setTimeout(function(){
console.log('Servidor não respondeu');
process.exit();
}, 5000);
// Começa o envio de dados aleatórios sem \r\n
var write = function(client){
// Intervalo pequeno para floodar
setInterval(function(){
client.write('oduhuhp937dg937dg09yG)(&#Gd097dg-9q&#gd9Q#&DGhjwsdl*#HP()D&' +
'*G#)d97F(&PDOIUYDP#O*DG@(#*&DG)(#GFD)*YGEOQDIUYEGDO&*#@Gd(@#&DG)923&dg');
}, 1);
};
var client = tls.connect(config.port, config.host, function(){
console.log('Conectado!');
// Remove o intervalo, conectamos
clearTimeout(timer);
// Começa o envio de lixo
write(client);
});
client.on('data', function(data){
console.log('> Server respondeu: %s', data);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment