13
Socket.io dan Node Tech Talk JDV. 2014

Qiscus TechTalk - Real-time Website with Node.js (socket.io)

  • Upload
    qiscus

  • View
    546

  • Download
    2

Embed Size (px)

Citation preview

Page 1: Qiscus TechTalk - Real-time Website with Node.js (socket.io)

Socket.io dan NodeTech Talk JDV. 2014

Page 2: Qiscus TechTalk - Real-time Website with Node.js (socket.io)

Selamat Sore~

Rifqi [email protected]

[email protected]

Page 3: Qiscus TechTalk - Real-time Website with Node.js (socket.io)

Apa itu Node, enak ga?

Page 4: Qiscus TechTalk - Real-time Website with Node.js (socket.io)

Node : Non Blocking I/O

sumber img : https://strongloop.com

Page 5: Qiscus TechTalk - Real-time Website with Node.js (socket.io)

Node : Tidak hanya platform, namun juga module

sumber img : https://strongloop.com

Page 6: Qiscus TechTalk - Real-time Website with Node.js (socket.io)

Tentang Node

Tanya dong mas...

Page 7: Qiscus TechTalk - Real-time Website with Node.js (socket.io)

Web Socket

1. Cross Origin Communication2. Proxy, Firewall problem3. Open Connection, High Concurrency + Low

Cost

Page 8: Qiscus TechTalk - Real-time Website with Node.js (socket.io)

Web Socket

sumber img : http://www.websocket.org/

Request

Response

Page 9: Qiscus TechTalk - Real-time Website with Node.js (socket.io)

Socket.io : Fitur

1. Mekanisme ‘Fallback’2. Room3. Namespace4. Authentifikasi

Page 10: Qiscus TechTalk - Real-time Website with Node.js (socket.io)

Socket.io : KonfigurasiMekanisme Fallback :

io.set('transports', [ 'websocket' , 'flashsocket' , 'htmlfile' , 'xhr-polling' , 'jsonp-polling' ]);

Page 11: Qiscus TechTalk - Real-time Website with Node.js (socket.io)

Socket.io : Authentifikasi

1. Global dan Namespace2. HanshakeData{ headers: req.headers // <Object> the headers of the request , time: (new Date) +'' // <String> date time of the connection , address: socket.address() // <Object> remoteAddress and remotePort object , xdomain: !!headers.origin // <Boolean> was it a cross domain request? , secure: socket.secure // <Boolean> https connection , issued: +date // <Number> EPOCH of when the handshake was created , url: request.url // <String> the entrance path of the request , query: data.query // <Object> the result of url.parse().query or a empty object}

Page 12: Qiscus TechTalk - Real-time Website with Node.js (socket.io)

Demo Socket.io

Lihat dong mas...

Page 13: Qiscus TechTalk - Real-time Website with Node.js (socket.io)

Terima Kasih

[email protected]