Suche senden
Hochladen
Web Socket Communication Guide
•
Als PPTX, PDF herunterladen
•
5 gefällt mir
•
4,109 views
Durch KI verbesserter Titel
Eyal Vardi
Folgen
Node.js Socket.IO
Weniger lesen
Mehr lesen
Technologie
Melden
Teilen
Melden
Teilen
1 von 24
Jetzt herunterladen
Empfohlen
Real Time Communication using Node.js and Socket.io
Real Time Communication using Node.js and Socket.io
Mindfire Solutions
Socket.IO
Socket.IO
Davide Pedranz
Node js overview
Node js overview
Eyal Vardi
Going realtime with Socket.IO
Going realtime with Socket.IO
Christian Joudrey
Presentation elbow
Presentation elbow
Habrol Afzam
Introduction to WebSockets Presentation
Introduction to WebSockets Presentation
Julien LaPointe
Knee pain
Knee pain
ferrokid
Advanced Node.JS Meetup
Advanced Node.JS Meetup
LINAGORA
Empfohlen
Real Time Communication using Node.js and Socket.io
Real Time Communication using Node.js and Socket.io
Mindfire Solutions
Socket.IO
Socket.IO
Davide Pedranz
Node js overview
Node js overview
Eyal Vardi
Going realtime with Socket.IO
Going realtime with Socket.IO
Christian Joudrey
Presentation elbow
Presentation elbow
Habrol Afzam
Introduction to WebSockets Presentation
Introduction to WebSockets Presentation
Julien LaPointe
Knee pain
Knee pain
ferrokid
Advanced Node.JS Meetup
Advanced Node.JS Meetup
LINAGORA
API for Beginners
API for Beginners
Sébastien Saunier
Management Zabbix with Terraform
Management Zabbix with Terraform
Aécio Pires
Flask
Flask
Mamta Kumari
Plantar fasciitis- my second oral revalida presentation
Plantar fasciitis- my second oral revalida presentation
Karla Suzatte Dasargo
gRPC: The Story of Microservices at Square
gRPC: The Story of Microservices at Square
Apigee | Google Cloud
NoSQL 위에서 MMORPG 개발하기
NoSQL 위에서 MMORPG 개발하기
Hoyoung Choi
Callbacks, Promises, and Coroutines (oh my!): Asynchronous Programming Patter...
Callbacks, Promises, and Coroutines (oh my!): Asynchronous Programming Patter...
Domenic Denicola
Elbow examination
Elbow examination
Dhananjaya Sabat
Achilles Tendonitis/Rupture
Achilles Tendonitis/Rupture
Tim Freitas
Real World Event Sourcing and CQRS
Real World Event Sourcing and CQRS
Matthew Hawkins
[2018.10.19] 김용기 부장 - IAC on OpenStack (feat. ansible)
[2018.10.19] 김용기 부장 - IAC on OpenStack (feat. ansible)
OpenStack Korea Community
Introduction to Nginx
Introduction to Nginx
Knoldus Inc.
What is REST API? REST API Concepts and Examples | Edureka
What is REST API? REST API Concepts and Examples | Edureka
Edureka!
Intro to WebSockets
Intro to WebSockets
Gaurav Oberoi
Event Sourcing with Kotlin, who needs frameworks!
Event Sourcing with Kotlin, who needs frameworks!
Nico Krijnen
Plantar fascitis final
Plantar fascitis final
Ankur Mittal
Kohler's disease
Kohler's disease
Yash Oza
Basic Concept of Node.js & NPM
Basic Concept of Node.js & NPM
Bhargav Anadkat
Radial nerve injury
Radial nerve injury
EuniceSusan
Enhancing Network and Runtime Security with Cilium and Tetragon by Raymond De...
Enhancing Network and Runtime Security with Cilium and Tetragon by Raymond De...
ContainerDay Security 2023
Node.js File system & Streams
Node.js File system & Streams
Eyal Vardi
Node.js Event Emitter
Node.js Event Emitter
Eyal Vardi
Weitere ähnliche Inhalte
Was ist angesagt?
API for Beginners
API for Beginners
Sébastien Saunier
Management Zabbix with Terraform
Management Zabbix with Terraform
Aécio Pires
Flask
Flask
Mamta Kumari
Plantar fasciitis- my second oral revalida presentation
Plantar fasciitis- my second oral revalida presentation
Karla Suzatte Dasargo
gRPC: The Story of Microservices at Square
gRPC: The Story of Microservices at Square
Apigee | Google Cloud
NoSQL 위에서 MMORPG 개발하기
NoSQL 위에서 MMORPG 개발하기
Hoyoung Choi
Callbacks, Promises, and Coroutines (oh my!): Asynchronous Programming Patter...
Callbacks, Promises, and Coroutines (oh my!): Asynchronous Programming Patter...
Domenic Denicola
Elbow examination
Elbow examination
Dhananjaya Sabat
Achilles Tendonitis/Rupture
Achilles Tendonitis/Rupture
Tim Freitas
Real World Event Sourcing and CQRS
Real World Event Sourcing and CQRS
Matthew Hawkins
[2018.10.19] 김용기 부장 - IAC on OpenStack (feat. ansible)
[2018.10.19] 김용기 부장 - IAC on OpenStack (feat. ansible)
OpenStack Korea Community
Introduction to Nginx
Introduction to Nginx
Knoldus Inc.
What is REST API? REST API Concepts and Examples | Edureka
What is REST API? REST API Concepts and Examples | Edureka
Edureka!
Intro to WebSockets
Intro to WebSockets
Gaurav Oberoi
Event Sourcing with Kotlin, who needs frameworks!
Event Sourcing with Kotlin, who needs frameworks!
Nico Krijnen
Plantar fascitis final
Plantar fascitis final
Ankur Mittal
Kohler's disease
Kohler's disease
Yash Oza
Basic Concept of Node.js & NPM
Basic Concept of Node.js & NPM
Bhargav Anadkat
Radial nerve injury
Radial nerve injury
EuniceSusan
Enhancing Network and Runtime Security with Cilium and Tetragon by Raymond De...
Enhancing Network and Runtime Security with Cilium and Tetragon by Raymond De...
ContainerDay Security 2023
Was ist angesagt?
(20)
API for Beginners
API for Beginners
Management Zabbix with Terraform
Management Zabbix with Terraform
Flask
Flask
Plantar fasciitis- my second oral revalida presentation
Plantar fasciitis- my second oral revalida presentation
gRPC: The Story of Microservices at Square
gRPC: The Story of Microservices at Square
NoSQL 위에서 MMORPG 개발하기
NoSQL 위에서 MMORPG 개발하기
Callbacks, Promises, and Coroutines (oh my!): Asynchronous Programming Patter...
Callbacks, Promises, and Coroutines (oh my!): Asynchronous Programming Patter...
Elbow examination
Elbow examination
Achilles Tendonitis/Rupture
Achilles Tendonitis/Rupture
Real World Event Sourcing and CQRS
Real World Event Sourcing and CQRS
[2018.10.19] 김용기 부장 - IAC on OpenStack (feat. ansible)
[2018.10.19] 김용기 부장 - IAC on OpenStack (feat. ansible)
Introduction to Nginx
Introduction to Nginx
What is REST API? REST API Concepts and Examples | Edureka
What is REST API? REST API Concepts and Examples | Edureka
Intro to WebSockets
Intro to WebSockets
Event Sourcing with Kotlin, who needs frameworks!
Event Sourcing with Kotlin, who needs frameworks!
Plantar fascitis final
Plantar fascitis final
Kohler's disease
Kohler's disease
Basic Concept of Node.js & NPM
Basic Concept of Node.js & NPM
Radial nerve injury
Radial nerve injury
Enhancing Network and Runtime Security with Cilium and Tetragon by Raymond De...
Enhancing Network and Runtime Security with Cilium and Tetragon by Raymond De...
Andere mochten auch
Node.js File system & Streams
Node.js File system & Streams
Eyal Vardi
Node.js Event Emitter
Node.js Event Emitter
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
Modules in ECMAScript 6.0
Modules in ECMAScript 6.0
Eyal Vardi
Andere mochten auch
(20)
Node.js File system & Streams
Node.js File system & Streams
Node.js Event Emitter
Node.js Event Emitter
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
Modules in ECMAScript 6.0
Modules in ECMAScript 6.0
Ähnlich wie 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
Ähnlich wie 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 и приятели
Mehr von 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
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
Mehr von Eyal Vardi
(12)
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
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
Kürzlich hochgeladen
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
Dubai Multi Commodity Centre
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
Rizwan Syed
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
Curtis Poe
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
LoriGlavin3
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
BookNet Canada
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
LoriGlavin3
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
Addepto
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
Fwdays
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
gvaughan
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
LoriGlavin3
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
Slibray Presentation
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
Pixlogix Infotech
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
ScyllaDB
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
Sergiu Bodiu
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
Commit University
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
Alan Dix
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
UiPathCommunity
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
Lars Bell
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
NavinnSomaal
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
BookNet Canada
Kürzlich hochgeladen
(20)
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
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.
Jetzt herunterladen