3 ms·
You should add some antispam, at least. I was able to keep your server down by using only this: > setInterval( function () { for(i=0;i<=9999; i++) { ws
by alexdumitru 10y ago
You should add some antispam, at least.
I was able to keep your server down by using only this:
> setInterval(
function () {
for(i=0;i<=9999; i++) {
ws.send(JSON.stringify({ type: 'message', username: $('#username').text(), message: 'seems like the ws server is fucked. stop spamming' }));
}
}, 1000);
- josephernest 10y agoThis small chat is intented for a small team, not for global internet usage like I do here :) Usually in a small team there is no spammer, and if there is one, he's banned quickly from the team :) But yes, I'm open to contribution about antispam / flood control. Constructive additions appreciated :)
- vmorgulis 10y agoI like a log the design. https://github.com/josephernest/talktalktalk/blob/master/talktalktalk.html#L268 https://github.com/josephernest/talktalktalk/blob/master/tal... I think you could escape the text from #writing before sending it. http://stackoverflow.com/a/4835406 http://stackoverflow.com/a/4835406
- josephernest 10y agoWell the real cleaning / sanitizing part has to be done on the server... I'll work on this in the next weeks, after some other more important projects... This is just a proof-of-concept fun project anyway :)
- josephernest 10y agoThanks @alexdumitru for pointing me this. I implemented a basic flood control (https://github.com/josephernest/talktalktalk/commit/43877bd10deb478343b48d721d418d8fedb91efb https://github.com/josephernest/talktalktalk/commit/43877bd1...), and now such a script doesn't work anymore. Of course you can then do another script that would automatically reconnect after being kicked out, etc.