-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclient.js
34 lines (23 loc) · 1.24 KB
/
client.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
var challenges = require('./flags.json');
var socket1 = require('socket.io-client')('http://127.0.0.1:8080', { forceNew: true });
var socket2 = require('socket.io-client')('http://127.0.0.1:8080', { forceNew: true });
socket1.emit('load', challenges.chat.room);
socket2.emit('load', challenges.chat.room);
socket2.emit('login', {user: 'Taylor Swift', avatar: '[email protected]', id: challenges.chat.room});
socket1.emit('login', {user: 'Katy Perry', avatar: '[email protected]', id: challenges.chat.room});
socket1.emit('msg',
{msg: 'Hey TayTay, can we just squash this beef?!?',
user: 'Katy Perry',
img: 'http://www.gravatar.com/avatar/8127c81e47d0c8383164b7297fd25174?s=140&r=x&d=mm'});
socket1.emit('msg',
{msg: 'I know you stole my dance but Im over it!',
user: 'Katy Perry',
img: 'http://www.gravatar.com/avatar/8127c81e47d0c8383164b7297fd25174?s=140&r=x&d=mm'});
socket2.emit('msg',
{msg: 'Uhhh no? You called me mean names',
user: 'Taylor Swift',
img: 'http://www.gravatar.com/avatar/67ae964ebbf3a62ef1f9735b20250128?s=140&r=x&d=mm'});
socket2.emit('msg',
{msg: 'WTF KATY! Flag: ' + challenges.chat.flag,
user: 'Taylor Swift',
img: 'http://www.gravatar.com/avatar/67ae964ebbf3a62ef1f9735b20250128?s=140&r=x&d=mm'});