ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
Socket.io dan Node
Tech Talk JDV. 2014
Selamat Sore~
Rifqi Alfian
@merembablas
mootuts.com
Freelancer
merembablas@gmail.com
Apa itu Node, enak ga?
Node : Non Blocking I/O

sumber img : https://strongloop.com
Node : Tidak hanya platform, namun juga module

sumber img : https://strongloop.com
Tentang Node
Tanya dong
mas...
Web Socket
1. Cross Origin Communication
2. Proxy, Firewall problem
3. Open Connection, High Concurrency + Low
Cost
Request

Web Socket

Response

sumber img : http://www.websocket.org/
Socket.io : Fitur
1.
2.
3.
4.

Mekanisme ‘Fallback’
Room
Namespace
Authentifikasi
Socket.io : Konfigurasi
Mekanisme Fallback :
io.set('transports', [
'websocket'
, 'flashsocket'
, 'htmlfile'
, 'xhr-polling'
, 'jsonp-polling'
]);
Socket.io : Authentifikasi
1. Global dan Namespace
2. 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
}
Demo Socket.io
Lihat dong
mas...
Terima Kasih
mootuts.com
merembablas@gmail.com

More Related Content

Socket.io tech talk 06022014