Enviar búsqueda
Cargar
Web Socket Communication Guide
•
Descargar como PPTX, PDF
•
5 recomendaciones
•
4,109 vistas
Título mejorado por IA
Eyal Vardi
Seguir
Node.js Socket.IO
Leer menos
Leer más
Tecnología
Denunciar
Compartir
Denunciar
Compartir
1 de 24
Descargar ahora
Recomendados
Real Time Communication using Node.js and Socket.io
Real Time Communication using Node.js and Socket.io
Mindfire Solutions
Apache Server Tutorial
Apache Server Tutorial
Jagat Kothari
Nginx internals
Nginx internals
liqiang xu
Ssh
Ssh
Raghu nath
CORS and (in)security
CORS and (in)security
n|u - The Open Security Community
F5 TLS & SSL Practices
F5 TLS & SSL Practices
Brian A. McHenry
Citrix Day 2014: XenApp / XenDesktop 7.6
Citrix Day 2014: XenApp / XenDesktop 7.6
Digicomp Academy AG
NGINX: Basics & Best Practices - EMEA Broadcast
NGINX: Basics & Best Practices - EMEA Broadcast
NGINX, Inc.
Recomendados
Real Time Communication using Node.js and Socket.io
Real Time Communication using Node.js and Socket.io
Mindfire Solutions
Apache Server Tutorial
Apache Server Tutorial
Jagat Kothari
Nginx internals
Nginx internals
liqiang xu
Ssh
Ssh
Raghu nath
CORS and (in)security
CORS and (in)security
n|u - The Open Security Community
F5 TLS & SSL Practices
F5 TLS & SSL Practices
Brian A. McHenry
Citrix Day 2014: XenApp / XenDesktop 7.6
Citrix Day 2014: XenApp / XenDesktop 7.6
Digicomp Academy AG
NGINX: Basics & Best Practices - EMEA Broadcast
NGINX: Basics & Best Practices - EMEA Broadcast
NGINX, Inc.
Apache web service
Apache web service
Manash Kumar Mondal
Http caching basics
Http caching basics
Martin Breest
Citrix Netscaler Deployment Guide
Citrix Netscaler Deployment Guide
Citrix
High Availability Content Caching with NGINX
High Availability Content Caching with NGINX
NGINX, Inc.
Basics of HTTP - Nafis Fuad
Basics of HTTP - Nafis Fuad
Cefalo
How to Build Real-time Chat App with Express, ReactJS, and Socket.IO?
How to Build Real-time Chat App with Express, ReactJS, and Socket.IO?
Katy Slemon
pfSense - Proxy autenticado no AD com inspeção SSL
pfSense - Proxy autenticado no AD com inspeção SSL
Cavalcante Treinamentos
Secure SHell
Secure SHell
Çağrı Çakır
OpenStack networking
OpenStack networking
Sim Janghoon
Single page applications
Single page applications
Diego Cardozo
Interagindo com web services RPC, SOAP e REST utilizando PHP
Interagindo com web services RPC, SOAP e REST utilizando PHP
Eduardo Cesar
NGINX: High Performance Load Balancing
NGINX: High Performance Load Balancing
NGINX, Inc.
SignalR Overview
SignalR Overview
Michael Sukachev
Going realtime with Socket.IO
Going realtime with Socket.IO
Christian Joudrey
Chef fundamentals
Chef fundamentals
Ygor Nascimento
HTTP Request Smuggling
HTTP Request Smuggling
Akash Ashokan
Certificate Management on pfSense 2.4 - pfSense Hangout September 2017
Certificate Management on pfSense 2.4 - pfSense Hangout September 2017
Netgate
CollabSphere SC 103 : Domino on the Web : Yes, It's (Probably) Hackable
CollabSphere SC 103 : Domino on the Web : Yes, It's (Probably) Hackable
Darren Duke
Huawei SAN Storage How To - Assigning Management IP Address
Huawei SAN Storage How To - Assigning Management IP Address
IPMAX s.r.l.
OAuth 2.0
OAuth 2.0
Uwe Friedrichsen
Node.js File system & Streams
Node.js File system & Streams
Eyal Vardi
Node.js Event Emitter
Node.js Event Emitter
Eyal Vardi
Más contenido relacionado
La actualidad más candente
Apache web service
Apache web service
Manash Kumar Mondal
Http caching basics
Http caching basics
Martin Breest
Citrix Netscaler Deployment Guide
Citrix Netscaler Deployment Guide
Citrix
High Availability Content Caching with NGINX
High Availability Content Caching with NGINX
NGINX, Inc.
Basics of HTTP - Nafis Fuad
Basics of HTTP - Nafis Fuad
Cefalo
How to Build Real-time Chat App with Express, ReactJS, and Socket.IO?
How to Build Real-time Chat App with Express, ReactJS, and Socket.IO?
Katy Slemon
pfSense - Proxy autenticado no AD com inspeção SSL
pfSense - Proxy autenticado no AD com inspeção SSL
Cavalcante Treinamentos
Secure SHell
Secure SHell
Çağrı Çakır
OpenStack networking
OpenStack networking
Sim Janghoon
Single page applications
Single page applications
Diego Cardozo
Interagindo com web services RPC, SOAP e REST utilizando PHP
Interagindo com web services RPC, SOAP e REST utilizando PHP
Eduardo Cesar
NGINX: High Performance Load Balancing
NGINX: High Performance Load Balancing
NGINX, Inc.
SignalR Overview
SignalR Overview
Michael Sukachev
Going realtime with Socket.IO
Going realtime with Socket.IO
Christian Joudrey
Chef fundamentals
Chef fundamentals
Ygor Nascimento
HTTP Request Smuggling
HTTP Request Smuggling
Akash Ashokan
Certificate Management on pfSense 2.4 - pfSense Hangout September 2017
Certificate Management on pfSense 2.4 - pfSense Hangout September 2017
Netgate
CollabSphere SC 103 : Domino on the Web : Yes, It's (Probably) Hackable
CollabSphere SC 103 : Domino on the Web : Yes, It's (Probably) Hackable
Darren Duke
Huawei SAN Storage How To - Assigning Management IP Address
Huawei SAN Storage How To - Assigning Management IP Address
IPMAX s.r.l.
OAuth 2.0
OAuth 2.0
Uwe Friedrichsen
La actualidad más candente
(20)
Apache web service
Apache web service
Http caching basics
Http caching basics
Citrix Netscaler Deployment Guide
Citrix Netscaler Deployment Guide
High Availability Content Caching with NGINX
High Availability Content Caching with NGINX
Basics of HTTP - Nafis Fuad
Basics of HTTP - Nafis Fuad
How to Build Real-time Chat App with Express, ReactJS, and Socket.IO?
How to Build Real-time Chat App with Express, ReactJS, and Socket.IO?
pfSense - Proxy autenticado no AD com inspeção SSL
pfSense - Proxy autenticado no AD com inspeção SSL
Secure SHell
Secure SHell
OpenStack networking
OpenStack networking
Single page applications
Single page applications
Interagindo com web services RPC, SOAP e REST utilizando PHP
Interagindo com web services RPC, SOAP e REST utilizando PHP
NGINX: High Performance Load Balancing
NGINX: High Performance Load Balancing
SignalR Overview
SignalR Overview
Going realtime with Socket.IO
Going realtime with Socket.IO
Chef fundamentals
Chef fundamentals
HTTP Request Smuggling
HTTP Request Smuggling
Certificate Management on pfSense 2.4 - pfSense Hangout September 2017
Certificate Management on pfSense 2.4 - pfSense Hangout September 2017
CollabSphere SC 103 : Domino on the Web : Yes, It's (Probably) Hackable
CollabSphere SC 103 : Domino on the Web : Yes, It's (Probably) Hackable
Huawei SAN Storage How To - Assigning Management IP Address
Huawei SAN Storage How To - Assigning Management IP Address
OAuth 2.0
OAuth 2.0
Destacado
Node.js File system & Streams
Node.js File system & Streams
Eyal Vardi
Node.js Event Emitter
Node.js Event Emitter
Eyal Vardi
Node js overview
Node js overview
Eyal Vardi
Angular 2.0 Views
Angular 2.0 Views
Eyal Vardi
Modules and injector
Modules and injector
Eyal Vardi
Async & Parallel in JavaScript
Async & Parallel in JavaScript
Eyal Vardi
Angular 2.0 forms
Angular 2.0 forms
Eyal Vardi
Angular 2.0 Pipes
Angular 2.0 Pipes
Eyal Vardi
Http Communication in Angular 2.0
Http Communication in Angular 2.0
Eyal Vardi
Angular 2.0 Routing and Navigation
Angular 2.0 Routing and Navigation
Eyal Vardi
Node.js Spplication Scaling
Node.js Spplication Scaling
Eyal Vardi
Routing And Navigation
Routing And Navigation
Eyal Vardi
Angular 2 NgModule
Angular 2 NgModule
Eyal Vardi
Template syntax in Angular 2.0
Template syntax in Angular 2.0
Eyal Vardi
Upgrading from Angular 1.x to Angular 2.x
Upgrading from Angular 1.x to Angular 2.x
Eyal Vardi
Component lifecycle hooks in Angular 2.0
Component lifecycle hooks in Angular 2.0
Eyal Vardi
Angular 2.0 Dependency injection
Angular 2.0 Dependency injection
Eyal Vardi
Angular 2 - Ahead of-time Compilation
Angular 2 - Ahead of-time Compilation
Eyal Vardi
Performance Optimization In Angular 2
Performance Optimization In Angular 2
Eyal Vardi
Angular 1.x vs. Angular 2.x
Angular 1.x vs. Angular 2.x
Eyal Vardi
Destacado
(20)
Node.js File system & Streams
Node.js File system & Streams
Node.js Event Emitter
Node.js Event Emitter
Node js overview
Node js overview
Angular 2.0 Views
Angular 2.0 Views
Modules and injector
Modules and injector
Async & Parallel in JavaScript
Async & Parallel in JavaScript
Angular 2.0 forms
Angular 2.0 forms
Angular 2.0 Pipes
Angular 2.0 Pipes
Http Communication in Angular 2.0
Http Communication in Angular 2.0
Angular 2.0 Routing and Navigation
Angular 2.0 Routing and Navigation
Node.js Spplication Scaling
Node.js Spplication Scaling
Routing And Navigation
Routing And Navigation
Angular 2 NgModule
Angular 2 NgModule
Template syntax in Angular 2.0
Template syntax in Angular 2.0
Upgrading from Angular 1.x to Angular 2.x
Upgrading from Angular 1.x to Angular 2.x
Component lifecycle hooks in Angular 2.0
Component lifecycle hooks in Angular 2.0
Angular 2.0 Dependency injection
Angular 2.0 Dependency injection
Angular 2 - Ahead of-time Compilation
Angular 2 - Ahead of-time Compilation
Performance Optimization In Angular 2
Performance Optimization In Angular 2
Angular 1.x vs. Angular 2.x
Angular 1.x vs. Angular 2.x
Similar a Web Socket Communication Guide
HTML 5 - Web Sockets
HTML 5 - Web Sockets
Eyal Vardi
HTTP
HTTP
Daniel Kummer
HTTP Caching in Web Application
HTTP Caching in Web Application
Martins Sipenko
Interactive web. O rly?
Interactive web. O rly?
timbc
Revisiting HTTP/2
Revisiting HTTP/2
Fastly
Http2 kotlin
Http2 kotlin
Andrii Bezruchko
Introduction HTTP via cURL
Introduction HTTP via cURL
Kyosuke MOROHASHI
HTTP/2, SPDY e Otimizações Web - Front In Maceió 2014 - Sérgio Lopes
HTTP/2, SPDY e Otimizações Web - Front In Maceió 2014 - Sérgio Lopes
Caelum
Web sockets
Web sockets
bodokaiser
Devoxx Maroc 2015 HTTP 1, HTTP 2 and folks
Devoxx Maroc 2015 HTTP 1, HTTP 2 and folks
Nicolas Martignole
20190516 web security-basic
20190516 web security-basic
MksYi
WebSockets On Fire
WebSockets On Fire
Jef Claes
Making the Most of HTTP In Your Apps
Making the Most of HTTP In Your Apps
Ben Ramsey
Web Real-time Communications
Web Real-time Communications
Alexei Skachykhin
How HTTP/2 will change the web as we know it
How HTTP/2 will change the web as we know it
Nils De Moor
How HTTP/2 will change the web as we know it
How HTTP/2 will change the web as we know it
Woorank
DEF CON 27- ALBINOWAX - http desync attacks
DEF CON 27- ALBINOWAX - http desync attacks
Felipe Prado
WebSockets - Today, in the Past, in Future and in Production.
WebSockets - Today, in the Past, in Future and in Production.
bodokaiser
IBM dwLive, "Internet & HTTP - 잃어버린 패킷을 찾아서..."
IBM dwLive, "Internet & HTTP - 잃어버린 패킷을 찾아서..."
Dongwook Lee
5. HTTP и приятели
5. HTTP и приятели
Stefan Kanev
Similar a Web Socket Communication Guide
(20)
HTML 5 - Web Sockets
HTML 5 - Web Sockets
HTTP
HTTP
HTTP Caching in Web Application
HTTP Caching in Web Application
Interactive web. O rly?
Interactive web. O rly?
Revisiting HTTP/2
Revisiting HTTP/2
Http2 kotlin
Http2 kotlin
Introduction HTTP via cURL
Introduction HTTP via cURL
HTTP/2, SPDY e Otimizações Web - Front In Maceió 2014 - Sérgio Lopes
HTTP/2, SPDY e Otimizações Web - Front In Maceió 2014 - Sérgio Lopes
Web sockets
Web sockets
Devoxx Maroc 2015 HTTP 1, HTTP 2 and folks
Devoxx Maroc 2015 HTTP 1, HTTP 2 and folks
20190516 web security-basic
20190516 web security-basic
WebSockets On Fire
WebSockets On Fire
Making the Most of HTTP In Your Apps
Making the Most of HTTP In Your Apps
Web Real-time Communications
Web Real-time Communications
How HTTP/2 will change the web as we know it
How HTTP/2 will change the web as we know it
How HTTP/2 will change the web as we know it
How HTTP/2 will change the web as we know it
DEF CON 27- ALBINOWAX - http desync attacks
DEF CON 27- ALBINOWAX - http desync attacks
WebSockets - Today, in the Past, in Future and in Production.
WebSockets - Today, in the Past, in Future and in Production.
IBM dwLive, "Internet & HTTP - 잃어버린 패킷을 찾아서..."
IBM dwLive, "Internet & HTTP - 잃어버린 패킷을 찾아서..."
5. HTTP и приятели
5. HTTP и приятели
Más de Eyal Vardi
Why magic
Why magic
Eyal Vardi
Smart Contract
Smart Contract
Eyal Vardi
Rachel's grandmother's recipes
Rachel's grandmother's recipes
Eyal Vardi
Angular 2 Architecture (Bucharest 26/10/2016)
Angular 2 Architecture (Bucharest 26/10/2016)
Eyal Vardi
Angular 2 Architecture
Angular 2 Architecture
Eyal Vardi
Modules in ECMAScript 6.0
Modules in ECMAScript 6.0
Eyal Vardi
Proxies in ECMAScript 6.0
Proxies in ECMAScript 6.0
Eyal Vardi
Iterators & Generators in ECMAScript 6.0
Iterators & Generators in ECMAScript 6.0
Eyal Vardi
Symbols in ECMAScript 6.0
Symbols in ECMAScript 6.0
Eyal Vardi
Objects & Classes in ECMAScript 6.0
Objects & Classes in ECMAScript 6.0
Eyal Vardi
Scope & Functions in ECMAScript 6.0
Scope & Functions in ECMAScript 6.0
Eyal Vardi
AngularJS Internal
AngularJS Internal
Eyal Vardi
Node.js Express
Node.js Express
Eyal Vardi
Más de Eyal Vardi
(13)
Why magic
Why magic
Smart Contract
Smart Contract
Rachel's grandmother's recipes
Rachel's grandmother's recipes
Angular 2 Architecture (Bucharest 26/10/2016)
Angular 2 Architecture (Bucharest 26/10/2016)
Angular 2 Architecture
Angular 2 Architecture
Modules in ECMAScript 6.0
Modules in ECMAScript 6.0
Proxies in ECMAScript 6.0
Proxies in ECMAScript 6.0
Iterators & Generators in ECMAScript 6.0
Iterators & Generators in ECMAScript 6.0
Symbols in ECMAScript 6.0
Symbols in ECMAScript 6.0
Objects & Classes in ECMAScript 6.0
Objects & Classes in ECMAScript 6.0
Scope & Functions in ECMAScript 6.0
Scope & Functions in ECMAScript 6.0
AngularJS Internal
AngularJS Internal
Node.js Express
Node.js Express
Último
Slack Application Development 101 Slides
Slack Application Development 101 Slides
praypatel2
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
Paola De la Torre
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Patryk Bandurski
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
Allon Mureinik
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
soniya singh
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
Memoori
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
Scott Keck-Warren
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
Maria Levchenko
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
Mark Billinghurst
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
2toLead Limited
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
HampshireHUG
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
XfilesPro
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
naman860154
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
OnBoard
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
How to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
naman860154
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
Gabriella Davis
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Safe Software
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
Sinan KOZAK
Último
(20)
Slack Application Development 101 Slides
Slack Application Development 101 Slides
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
How to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
Web Socket Communication Guide
1.
2.
© 2014 All
rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com
3.
4.
Polling interval
5.
6.
HTTP/1.1 200 OK Content-Type:
text/plain Transfer-Encoding: chunked <script>eval("... ")</script>0 <script>eval("... ")</script>0
7.
8.
© 2014 All
rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com
9.
© 2014 All
rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com HTTP/1.1 101 Switching Protocols Upgrade: websocket Connection: Upgrade Sec-WebSocket-Accept: HSmrc0sMlYUkAGmm5OPpG2HaGWk= Sec-WebSocket-Protocol: chat GET /mychat HTTP/1.1 Host: server.example.com Upgrade: websocket Connection: Upgrade Sec-WebSocket-Key: x3JJHMbDL1EzLkh9GBhXDw== Sec-WebSocket-Protocol: chat Sec-WebSocket-Version: 13 Origin: http://example.com Client Server
10.
© 2014 All
rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com
11.
var myWebSocket =
new WebSocket("ws://www.websockets.org"); myWebSocket.onopen = function(evt) { alert("Connection open ..."); }; myWebSocket.onmessage = function(evt) { alert("Received Message: " + evt.data); }; myWebSocket.onclose = function(evt) { alert("Connection closed."); } myWebSocket.send("Hello WebSockets!"); myWebSocket.close();
12.
Web Socket Echo (http://www.websocket.org/echo.html)
13.
14.
© 2014 All
rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com
15.
© 2014 All
rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com var http = require("http"); var connect = require("connect"); var socketio = require("socket.io"); var app = connect(); app.use(connect.static("public")); var server = http.createServer(app); var io = socketio.listen(server); io.on("connection", function (socket) { socket.on("message", function (data) { socket.emit("echo", data); }); }); server.listen(8000);
16.
© 2014 All
rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com <!DOCTYPE html> <html> <head> <script src="/socket.io/socket.io.js"></script> </head> <body> <body> <script> var socket = io.connect("http://localhost"); socket.emit("message", "Hello!"); socket.on("echo", function(data) { document.write(data); }); </script> </body> </html>
17.
© 2014 All
rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com io.emit('some event', { for: 'everyone' }); socket.broadcast.emit('some event');
18.
19.
© 2014 All
rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com // Server Side var nsp = io.of('/my-namespace'); nsp.on('connection', function(socket) { console.log('someone connected'); }); nsp.emit('hi', 'everyone!'); // Client Side var socket = io('/my-namespace');
20.
© 2014 All
rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com io.on('connection', function (socket) { socket.join('some room'); }); io.to('some room').emit('some event');
21.
© 2014 All
rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com
22.
© 2014 All
rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com var mi = angular.module('myApp', ['btford.socket-io']); mi.factory('mySocket', function (socketFactory) { return socketFactory(); }); mi.controller('MyCtrl', function(mySocket) { // ... });
23.
© 2014 All
rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com angular.module(‘socketioApp') .controller('MainCtrl', function($scope, socket) { } socket.forward(‘my-event', $scope); $scope.$on(‘socket:my-event', function (event, serverData) { $scope.data = serverData; }); socket.emit(‘event-from-client’, someData) Allows you to forward the events received by Socket.IO's socket to AngularJS's event system.
Descargar ahora