-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
26 lines (24 loc) · 1.08 KB
/
README
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
Socket.io example description.
Date : 2016-08-19 14:54
Description : The example use socket.io library to build client and server
communication by web socket.
Reference site :
https://blog.gtwang.org/programming/socket-io-node-js-realtime-app/
Requirement:
1. Install nodeJS(please select your os platform)
2. Install socket.io(Use npm or other)
3. Create server.js and client.html
Step :
1. Create http server(server.js)
2. Set http server router by path(server.js)
3. Set http page from file system by fs library(server.js)
4. Include socket.io library(server.js)
5. Create socket.io instance after http server listen(server.js).
6. Use 'socket.emit()' function to send message(date format)
to user(server.js).
7. Declare socket instance at client.html(client.html).
8. Use 'socket.on()' function to receive server message and use jquery
to assign in element(client.html).
9. Use 'socket.emit()' function to send message(from textarea) to server.
10.Use 'socket.on()' function to receive client message
from client.html(server.js)