-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathexpress.io.express.txt
37 lines (31 loc) · 1.98 KB
/
express.io.express.txt
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
32
33
34
35
36
37
┏━━━━━━━━━━━━━━━━┓
┃ EXPRESS.IO ┃
┗━━━━━━━━━━━━━━━━┛
VERSION ==> #1.1.14 (careful not to pick 1.1.13)
#Uses Socket.io 0.9: diff??? Still not working properly, wait for update???
EXPRESS.IO() #Returns EAPP, same as Express APP, but with extra functions
EXPRESS.IO.io #Returns underlying Socket.io SIO
EAPP.http()
EAPP.http[s](OBJ) #Starts HTTP server???
EAPP.io() #Starts websocket server
EAPP.io.route #Fires FUNC when receiving SOCKET.IO EVENT_STR
(EVENT_STR, FUNC(REQ_OBJ)|OBJ)#Usually EVENT is RESOURCE and SUBEVENT ACTION
#If OBJ:
# - SUBEVENT FUNC(REQ_OBJ): same but for "EVENT:SUBEVENT"
#REQ_OBJ:
# - data VAL: message received
# - headers OBJ: of the original upgrade request
# - session: HTTP REQ.session
# - handshake: SV_WS.handshake
# - socket: SV_WS (prefer using io)
# - io:
# - [room(ROOM)]emit|broadcast(EVENT_STR[, VAL])
# - respond(VAL): when sender requested a callback
# - join|leave(ROOM)
# - route(EVENT_STR): like REQ.io.route(EVENT_STR)
# - disconnect(FUNC(???))
# - on(...): call underlying SV_WS.on(...)
EAPP.io[.room(ROOM_STR)]
.broadcast(EVENT_STR[, VAL]) #Emit to clients using underlying SIO
EAPP.io.configure|enable|set(???)
REQ.io.route(EVENT_STR) #Fires a websocket route inside a HTTP route