SlideShare ist ein Scribd-Unternehmen logo
1 von 44
Downloaden Sie, um offline zu lesen
WebSocket 
JERROMY 
2014.06
About Me 
• Jerromy Lee 
• National Taiwan University of ART 
• New Media Artist / Game Designer 
• iOS / Android / OF / Flash Developer 
• VRMZ ⼤大中華盃 VR盟主 ⾦金獎 
• 404 電⼦子藝術節 
• 上海電⼦子藝術節 
• 台北數位藝術節 
• 屏東影⾳音藝術節 
• 法國 安亙湖 互動表演 
• KT獎 遊戲設計 銀獎 
• 4C數位創作競賽 遊戲組 銀獎
About Me 
• Job Experience. 7 years 
• YAHOO 使⽤用者經驗設計師 
• 華夏技術學院兼任講師 
• 邊境數位科技 互動創意指導 
• 邊境數位科技 技術部主管 
• 科碼新媒體 新媒體藝術家
App Works 
• Experience. 
• iOS and 
Android 
Developer
http://www.corma.com.tw/
Connection tech. 
• Bluetooth 1.0~4.0 
• Server get / post (Web Service) 
• Socket Server (Socket Server / WebSocket) 
• Peer to Peer 
• iOS - Multipeer Connectivity 
• https://vimeo.com/95407383 
• Without Internet Environment 
• Android - Wifi direct 
• Without Internet Environment
Works intro. 
• Super Sync Sports 
• http://chrome.com/supersyncsports/#/en-US 
• MacDonald 
• https://www.youtube.com/watch?v=8BVZ_rn7bIY 
• Sony Make TV 
• https://www.youtube.com/watch?v=dEAgynm3Ng8 
• Mr. Chia (CORMA) 
• http://www.ilovechia.biz/event/1301/
Super Sync Sports 
• http://chrome.com/supersyncsports/#/en-US
MacDonald 
• https://www.youtube.com/watch?v=8BVZ_rn7bIY
Sony Make TV 
• https://www.youtube.com/watch?v=dEAgynm3Ng8
Mr. CHIA 
• http://www.ilovechia.biz/event/1301/
Works intro. 
• Play 玩劇 
• https://www.youtube.com/watch?v=0m0rfCpN-V8 
• Mobi Waver 
• https://www.youtube.com/watch?v=bxY7x-XNR_w 
• Flying 
• https://www.youtube.com/watch?v=V_l9EI-5mLY 
• Who (數⽀支數⽀支 進⾏行中) 
• the nearest I 
• https://vimeo.com/95245928
玩劇 
• https://www.youtube.com/watch?v=0m0rfCpN-V8
Mobi Waver 
• https://www.youtube.com/watch?v=bxY7x-XNR_w
Flying 
• https://www.youtube.com/watch?v=V_l9EI-5mLY
the nearest I 
• https://vimeo.com/95245928
WebSocket 
• Part of the HTML5 
• JavaScript interface 
• Uses the WebSocket protocol instead of HTTP 
• ws:// 
• wss:// 
• full-duplex 
• Why? Choose WebSocket? 
• Mobile
WebSocket 
• Browser Support (WebSocket Version 13) 
• http://caniuse.com/websockets 
• Google Chrome (Web & Mobile) 
• iOS 6 Safari 
• Mozilla Firefox 6 
• Opera 10.7 & 11.0 
• IE 10
WebSocket 
• Architecture 
• http:// 
www.websocket.org/ 
aboutwebsocket.html
WebSocket 
• Server-Side Choosing 
• PHP WebSocket 
• Node.js 
• C# .Net 
• Client-Side 
• iOS (Socket Rocket) 
• https://github.com/square/SocketRocket 
• Android (Java WebSocket) 
• https://github.com/TooTallNate/Java-WebSocket 
• HTML Client (Javascript WebSocket Api) 
• http://www.websocket.org/echo.html
Tools intro. 
• Parse — Cloud Backend Service 
• https://www.parse.com 
• Create JS — JavaScript Visual Coding Library tool 
• http://createjs.com/#!/CreateJS 
• MAMP — PHP WebService 
• http://www.mamp.info/en/ 
• XAMPP — PHP WebService 
• https://www.apachefriends.org/zh_tw/index.html 
• Google Chrome — JavaScript Debug Tools 
• http://www.google.com.tw/intl/zh-TW/chrome/browser/ 
• Sublime Text — HTML / JavaScript Text Editor 
• http://www.sublimetext.com
WebSocket 
• Web VS App 
• Web — easy connect, needn’t install 
• App — need install 
• http://www.mesona.com.tw/app/
JavaScript Basic 
• JavaScript Basic 
• Tools: Google Chrome / Sublime
JavaScript Basic 
• console.log(“Hello World”);
JavaScript Basic 
• WebSocket JS 
• var ws = new WebSocket(“ws://127.0.0.1:8080”); 
• ws.onopen = function(){ //Connected to WebSocket server }; 
• ws.onclose = function(){ //Disconnected }; 
• ws.onmessage = function(msg){ //incoming message}; 
• ws.send(“hello, world!”); 
• ws.close(); //close the WebSocket connection
JavaScript Basic 
• Google Chrome Debug Tools.
JavaScript Basic 
• EaselJS, deal the visual 
• Like Flash Action Script 3 
• The intro of HTML 5 Canvas 
• http://www.createjs.com/#!/EaselJS
JavaScript Basic 
• EaselJS, deal the visual 
• Canvas — like flash stage 
• var stage = new createjs.Stage("demoCanvas"); 
• http://www.w3schools.com/html/html5_canvas.asp
JavaScript Basic 
• EaselJS 
• http://www.createjs.com/tutorials/Getting%20Started/ 
• <canvas id=“demoCanvas” width=“500” height=“500”></canvas>
JavaScript Basic 
var circle = new createjs.Shape(); 
circle.graphics.beginFill("red").drawCircle(0, 0, 50); 
circle.x = 100; 
circle.y = 100; 
stage.addChild(circle); 
stage.addChild(new createjs.Shape()).setTransform(100,100).graphics.f(“red").dc(0,0,50); 
stage.update();
Server Side 
• XAMPP / MAMP 
• https://www.apachefriends.org/zh_tw/index.html 
• http://www.mamp.info/en/ 
• PHP WebSocket 
• http://www.sanwebe.com/2013/05/chat-using-websocket- 
php-socket 
• https://github.com/Flynsarmy/PHPWebSocket-Chat
Server Side 
• Quick Start 
• install the XAMPP or MAMP 
• Put the php class(class.PHPWebSocket.php) and 
php file (serverMain.php) into the web root folder. 
• Write the client side program 
• testing……
Example File 
• File 
• https://dl.dropboxusercontent.com/u/ 
32940203/who_template_clean.zip
Server Side 
• Node.js 
• http://nodejs.tw/ 
• http://nodejs.org/
Server Side
Server Side 
• Node.js 
• Why node.js? 
• Socket I.O.
Server Side 
• Node.js 
• heroic 
• socketIO 
• wesocket npm 
• Choose a solution what you want
Server Side 
• Node.js 
• Step 0. Install the NodeJS 
• http://nodejs.org 
• Step 1. Node.js 
• console.log(“Hello World”);
Server Side 
• Node.js (Express) 
• Step 2. create package JSON 
• Step 3. mkdir hello-world 
• Step 4. sudo npm install 
• Step 5. sudo npm install -g express-generator 
• Step 6. sudo npm install -g express -t ejs testApp 
• Step 7. npm start 
• Step 8 http://localhost:3000
Server Side 
• Node.js 
• npm install --save socket.io 
• Example File: 
• http://expressjs.com 
• http://socket.io/get-started/chat/ 
• https://dl.dropboxusercontent.com/u/32940203/ 
simpleChat.zip
Complete the works 
• Goal: 
• ⼤大家⼀一起合⼒力擊破⿎鼓,不斷的按按鈕,集氣的 
概念,⼤大家⼀一起合⼒力不斷的按按鈕到⼀一定程度 
就可成功擊破.
Complete the works 
• End. 
• https://www.facebook.com/jerromy 
• jerromy@corma.com.tw

Weitere ähnliche Inhalte

Was ist angesagt?

Websocket protocol overview
Websocket protocol overviewWebsocket protocol overview
Websocket protocol overviewallenmeng
 
Node worshop Realtime - Socket.io
Node worshop Realtime - Socket.ioNode worshop Realtime - Socket.io
Node worshop Realtime - Socket.ioCaesar Chi
 
Realtime web application with java
Realtime web application with javaRealtime web application with java
Realtime web application with javaJeongHun Byeon
 
Large scale web socket system with AWS and Web socket
Large scale web socket system with AWS and Web socketLarge scale web socket system with AWS and Web socket
Large scale web socket system with AWS and Web socketLe Kien Truc
 
Spring + WebSocket integration
Spring + WebSocket integrationSpring + WebSocket integration
Spring + WebSocket integrationOleksandr Semenov
 
Using Websockets in Play !
Using Websockets in Play !Using Websockets in Play !
Using Websockets in Play !Knoldus Inc.
 
Real time web: is there a life without socket.io and node.js?
Real time web: is there a life without socket.io and node.js?Real time web: is there a life without socket.io and node.js?
Real time web: is there a life without socket.io and node.js?Eduard Trayan
 
Web sockets - Pentesting
Web sockets - Pentesting Web sockets - Pentesting
Web sockets - Pentesting Vandana Verma
 
Consuming ASP.NET Web API with WebSockets
Consuming ASP.NET Web API with WebSocketsConsuming ASP.NET Web API with WebSockets
Consuming ASP.NET Web API with WebSocketsMaayan Glikser
 
NodeJS & Socket IO on Microsoft Azure Cloud Web Sites - DWX 2014
NodeJS & Socket IO on Microsoft Azure Cloud Web Sites - DWX 2014NodeJS & Socket IO on Microsoft Azure Cloud Web Sites - DWX 2014
NodeJS & Socket IO on Microsoft Azure Cloud Web Sites - DWX 2014Stéphane ESCANDELL
 
The Case for HTTP/2 - EpicFEL Sept 2015
The Case for HTTP/2 - EpicFEL Sept 2015The Case for HTTP/2 - EpicFEL Sept 2015
The Case for HTTP/2 - EpicFEL Sept 2015Andy Davies
 
Websocket vs SSE - Paris.js - 24/06/15
Websocket vs SSE - Paris.js - 24/06/15Websocket vs SSE - Paris.js - 24/06/15
Websocket vs SSE - Paris.js - 24/06/15streamdata.io
 
Enhancing Mobile User Experience with WebSocket
Enhancing Mobile User Experience with WebSocketEnhancing Mobile User Experience with WebSocket
Enhancing Mobile User Experience with WebSocketMauricio "Maltron" Leal
 
Async Tasks with Django Channels
Async Tasks with Django ChannelsAsync Tasks with Django Channels
Async Tasks with Django ChannelsAlbert O'Connor
 

Was ist angesagt? (20)

Websocket protocol overview
Websocket protocol overviewWebsocket protocol overview
Websocket protocol overview
 
Node worshop Realtime - Socket.io
Node worshop Realtime - Socket.ioNode worshop Realtime - Socket.io
Node worshop Realtime - Socket.io
 
Realtime web application with java
Realtime web application with javaRealtime web application with java
Realtime web application with java
 
WebSockets and Java
WebSockets and JavaWebSockets and Java
WebSockets and Java
 
Large scale web socket system with AWS and Web socket
Large scale web socket system with AWS and Web socketLarge scale web socket system with AWS and Web socket
Large scale web socket system with AWS and Web socket
 
Websockets and SockJS, Real time chatting
Websockets and SockJS, Real time chattingWebsockets and SockJS, Real time chatting
Websockets and SockJS, Real time chatting
 
Spring + WebSocket integration
Spring + WebSocket integrationSpring + WebSocket integration
Spring + WebSocket integration
 
Dancing with websocket
Dancing with websocketDancing with websocket
Dancing with websocket
 
Using Websockets in Play !
Using Websockets in Play !Using Websockets in Play !
Using Websockets in Play !
 
Real time web: is there a life without socket.io and node.js?
Real time web: is there a life without socket.io and node.js?Real time web: is there a life without socket.io and node.js?
Real time web: is there a life without socket.io and node.js?
 
Single sign-on
Single sign-onSingle sign-on
Single sign-on
 
Python, WebRTC and You
Python, WebRTC and YouPython, WebRTC and You
Python, WebRTC and You
 
Web sockets - Pentesting
Web sockets - Pentesting Web sockets - Pentesting
Web sockets - Pentesting
 
Socket.IO
Socket.IOSocket.IO
Socket.IO
 
Consuming ASP.NET Web API with WebSockets
Consuming ASP.NET Web API with WebSocketsConsuming ASP.NET Web API with WebSockets
Consuming ASP.NET Web API with WebSockets
 
NodeJS & Socket IO on Microsoft Azure Cloud Web Sites - DWX 2014
NodeJS & Socket IO on Microsoft Azure Cloud Web Sites - DWX 2014NodeJS & Socket IO on Microsoft Azure Cloud Web Sites - DWX 2014
NodeJS & Socket IO on Microsoft Azure Cloud Web Sites - DWX 2014
 
The Case for HTTP/2 - EpicFEL Sept 2015
The Case for HTTP/2 - EpicFEL Sept 2015The Case for HTTP/2 - EpicFEL Sept 2015
The Case for HTTP/2 - EpicFEL Sept 2015
 
Websocket vs SSE - Paris.js - 24/06/15
Websocket vs SSE - Paris.js - 24/06/15Websocket vs SSE - Paris.js - 24/06/15
Websocket vs SSE - Paris.js - 24/06/15
 
Enhancing Mobile User Experience with WebSocket
Enhancing Mobile User Experience with WebSocketEnhancing Mobile User Experience with WebSocket
Enhancing Mobile User Experience with WebSocket
 
Async Tasks with Django Channels
Async Tasks with Django ChannelsAsync Tasks with Django Channels
Async Tasks with Django Channels
 

Ähnlich wie WEB SOCKET 應用

About Best friends - HTML, CSS and JS
About Best friends - HTML, CSS and JSAbout Best friends - HTML, CSS and JS
About Best friends - HTML, CSS and JSNaga Harish M
 
スマートフォンサイトの作成術 - 大川洋一
スマートフォンサイトの作成術 - 大川洋一スマートフォンサイトの作成術 - 大川洋一
スマートフォンサイトの作成術 - 大川洋一okyawa
 
HTML5 is the Future of Mobile, PhoneGap Takes You There Today
HTML5 is the Future of Mobile, PhoneGap Takes You There TodayHTML5 is the Future of Mobile, PhoneGap Takes You There Today
HTML5 is the Future of Mobile, PhoneGap Takes You There Todaydavyjones
 
Mobile Web Development with HTML5
Mobile Web Development with HTML5Mobile Web Development with HTML5
Mobile Web Development with HTML5Roy Clarkson
 
Build (Web)VR with A-Frame (COSCUP 2019 Taipei)
Build (Web)VR with A-Frame (COSCUP 2019 Taipei)Build (Web)VR with A-Frame (COSCUP 2019 Taipei)
Build (Web)VR with A-Frame (COSCUP 2019 Taipei)Robert 'Bob' Reyes
 
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)Doris Chen
 
Building AR and VR Experiences for Web Apps with JavaScript
Building AR and VR Experiences for Web Apps with JavaScriptBuilding AR and VR Experiences for Web Apps with JavaScript
Building AR and VR Experiences for Web Apps with JavaScriptFITC
 
Nodejs and WebSockets
Nodejs and WebSocketsNodejs and WebSockets
Nodejs and WebSocketsGonzalo Ayuso
 
HTML5: An Overview
HTML5: An OverviewHTML5: An Overview
HTML5: An OverviewNagendra Um
 
APIs, now and in the future
APIs, now and in the futureAPIs, now and in the future
APIs, now and in the futureChris Mills
 
Mobile App Development
Mobile App DevelopmentMobile App Development
Mobile App DevelopmentChris Morrell
 
SharePoint and Office 365 Development Workshop
SharePoint and Office 365 Development WorkshopSharePoint and Office 365 Development Workshop
SharePoint and Office 365 Development WorkshopEric Shupps
 
Mobile Vue.js – From PWA to Native
Mobile Vue.js – From PWA to NativeMobile Vue.js – From PWA to Native
Mobile Vue.js – From PWA to NativeMartinSotirov
 
soft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.jssoft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.jssoft-shake.ch
 

Ähnlich wie WEB SOCKET 應用 (20)

About Best friends - HTML, CSS and JS
About Best friends - HTML, CSS and JSAbout Best friends - HTML, CSS and JS
About Best friends - HTML, CSS and JS
 
Mobile native-hacks
Mobile native-hacksMobile native-hacks
Mobile native-hacks
 
スマートフォンサイトの作成術 - 大川洋一
スマートフォンサイトの作成術 - 大川洋一スマートフォンサイトの作成術 - 大川洋一
スマートフォンサイトの作成術 - 大川洋一
 
HTML5 is the Future of Mobile, PhoneGap Takes You There Today
HTML5 is the Future of Mobile, PhoneGap Takes You There TodayHTML5 is the Future of Mobile, PhoneGap Takes You There Today
HTML5 is the Future of Mobile, PhoneGap Takes You There Today
 
Mobile Web Development with HTML5
Mobile Web Development with HTML5Mobile Web Development with HTML5
Mobile Web Development with HTML5
 
Build (Web)VR with A-Frame (COSCUP 2019 Taipei)
Build (Web)VR with A-Frame (COSCUP 2019 Taipei)Build (Web)VR with A-Frame (COSCUP 2019 Taipei)
Build (Web)VR with A-Frame (COSCUP 2019 Taipei)
 
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
 
Nodejs web,db,hosting
Nodejs web,db,hostingNodejs web,db,hosting
Nodejs web,db,hosting
 
Building AR and VR Experiences for Web Apps with JavaScript
Building AR and VR Experiences for Web Apps with JavaScriptBuilding AR and VR Experiences for Web Apps with JavaScript
Building AR and VR Experiences for Web Apps with JavaScript
 
Html5 more than just html5 v final
Html5  more than just html5 v finalHtml5  more than just html5 v final
Html5 more than just html5 v final
 
HTML 5 - Overview
HTML 5 - OverviewHTML 5 - Overview
HTML 5 - Overview
 
Nodejs and WebSockets
Nodejs and WebSocketsNodejs and WebSockets
Nodejs and WebSockets
 
Node azure
Node azureNode azure
Node azure
 
WebVR, an offspring of two worlds
WebVR, an offspring of two worldsWebVR, an offspring of two worlds
WebVR, an offspring of two worlds
 
HTML5: An Overview
HTML5: An OverviewHTML5: An Overview
HTML5: An Overview
 
APIs, now and in the future
APIs, now and in the futureAPIs, now and in the future
APIs, now and in the future
 
Mobile App Development
Mobile App DevelopmentMobile App Development
Mobile App Development
 
SharePoint and Office 365 Development Workshop
SharePoint and Office 365 Development WorkshopSharePoint and Office 365 Development Workshop
SharePoint and Office 365 Development Workshop
 
Mobile Vue.js – From PWA to Native
Mobile Vue.js – From PWA to NativeMobile Vue.js – From PWA to Native
Mobile Vue.js – From PWA to Native
 
soft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.jssoft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.js
 

Kürzlich hochgeladen

New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 

Kürzlich hochgeladen (20)

New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 

WEB SOCKET 應用

  • 2. About Me • Jerromy Lee • National Taiwan University of ART • New Media Artist / Game Designer • iOS / Android / OF / Flash Developer • VRMZ ⼤大中華盃 VR盟主 ⾦金獎 • 404 電⼦子藝術節 • 上海電⼦子藝術節 • 台北數位藝術節 • 屏東影⾳音藝術節 • 法國 安亙湖 互動表演 • KT獎 遊戲設計 銀獎 • 4C數位創作競賽 遊戲組 銀獎
  • 3. About Me • Job Experience. 7 years • YAHOO 使⽤用者經驗設計師 • 華夏技術學院兼任講師 • 邊境數位科技 互動創意指導 • 邊境數位科技 技術部主管 • 科碼新媒體 新媒體藝術家
  • 4. App Works • Experience. • iOS and Android Developer
  • 6. Connection tech. • Bluetooth 1.0~4.0 • Server get / post (Web Service) • Socket Server (Socket Server / WebSocket) • Peer to Peer • iOS - Multipeer Connectivity • https://vimeo.com/95407383 • Without Internet Environment • Android - Wifi direct • Without Internet Environment
  • 7. Works intro. • Super Sync Sports • http://chrome.com/supersyncsports/#/en-US • MacDonald • https://www.youtube.com/watch?v=8BVZ_rn7bIY • Sony Make TV • https://www.youtube.com/watch?v=dEAgynm3Ng8 • Mr. Chia (CORMA) • http://www.ilovechia.biz/event/1301/
  • 8. Super Sync Sports • http://chrome.com/supersyncsports/#/en-US
  • 10. Sony Make TV • https://www.youtube.com/watch?v=dEAgynm3Ng8
  • 11. Mr. CHIA • http://www.ilovechia.biz/event/1301/
  • 12. Works intro. • Play 玩劇 • https://www.youtube.com/watch?v=0m0rfCpN-V8 • Mobi Waver • https://www.youtube.com/watch?v=bxY7x-XNR_w • Flying • https://www.youtube.com/watch?v=V_l9EI-5mLY • Who (數⽀支數⽀支 進⾏行中) • the nearest I • https://vimeo.com/95245928
  • 14. Mobi Waver • https://www.youtube.com/watch?v=bxY7x-XNR_w
  • 16. the nearest I • https://vimeo.com/95245928
  • 17.
  • 18. WebSocket • Part of the HTML5 • JavaScript interface • Uses the WebSocket protocol instead of HTTP • ws:// • wss:// • full-duplex • Why? Choose WebSocket? • Mobile
  • 19. WebSocket • Browser Support (WebSocket Version 13) • http://caniuse.com/websockets • Google Chrome (Web & Mobile) • iOS 6 Safari • Mozilla Firefox 6 • Opera 10.7 & 11.0 • IE 10
  • 20. WebSocket • Architecture • http:// www.websocket.org/ aboutwebsocket.html
  • 21. WebSocket • Server-Side Choosing • PHP WebSocket • Node.js • C# .Net • Client-Side • iOS (Socket Rocket) • https://github.com/square/SocketRocket • Android (Java WebSocket) • https://github.com/TooTallNate/Java-WebSocket • HTML Client (Javascript WebSocket Api) • http://www.websocket.org/echo.html
  • 22. Tools intro. • Parse — Cloud Backend Service • https://www.parse.com • Create JS — JavaScript Visual Coding Library tool • http://createjs.com/#!/CreateJS • MAMP — PHP WebService • http://www.mamp.info/en/ • XAMPP — PHP WebService • https://www.apachefriends.org/zh_tw/index.html • Google Chrome — JavaScript Debug Tools • http://www.google.com.tw/intl/zh-TW/chrome/browser/ • Sublime Text — HTML / JavaScript Text Editor • http://www.sublimetext.com
  • 23. WebSocket • Web VS App • Web — easy connect, needn’t install • App — need install • http://www.mesona.com.tw/app/
  • 24. JavaScript Basic • JavaScript Basic • Tools: Google Chrome / Sublime
  • 25. JavaScript Basic • console.log(“Hello World”);
  • 26. JavaScript Basic • WebSocket JS • var ws = new WebSocket(“ws://127.0.0.1:8080”); • ws.onopen = function(){ //Connected to WebSocket server }; • ws.onclose = function(){ //Disconnected }; • ws.onmessage = function(msg){ //incoming message}; • ws.send(“hello, world!”); • ws.close(); //close the WebSocket connection
  • 27. JavaScript Basic • Google Chrome Debug Tools.
  • 28. JavaScript Basic • EaselJS, deal the visual • Like Flash Action Script 3 • The intro of HTML 5 Canvas • http://www.createjs.com/#!/EaselJS
  • 29. JavaScript Basic • EaselJS, deal the visual • Canvas — like flash stage • var stage = new createjs.Stage("demoCanvas"); • http://www.w3schools.com/html/html5_canvas.asp
  • 30. JavaScript Basic • EaselJS • http://www.createjs.com/tutorials/Getting%20Started/ • <canvas id=“demoCanvas” width=“500” height=“500”></canvas>
  • 31. JavaScript Basic var circle = new createjs.Shape(); circle.graphics.beginFill("red").drawCircle(0, 0, 50); circle.x = 100; circle.y = 100; stage.addChild(circle); stage.addChild(new createjs.Shape()).setTransform(100,100).graphics.f(“red").dc(0,0,50); stage.update();
  • 32. Server Side • XAMPP / MAMP • https://www.apachefriends.org/zh_tw/index.html • http://www.mamp.info/en/ • PHP WebSocket • http://www.sanwebe.com/2013/05/chat-using-websocket- php-socket • https://github.com/Flynsarmy/PHPWebSocket-Chat
  • 33. Server Side • Quick Start • install the XAMPP or MAMP • Put the php class(class.PHPWebSocket.php) and php file (serverMain.php) into the web root folder. • Write the client side program • testing……
  • 34. Example File • File • https://dl.dropboxusercontent.com/u/ 32940203/who_template_clean.zip
  • 35. Server Side • Node.js • http://nodejs.tw/ • http://nodejs.org/
  • 36.
  • 38. Server Side • Node.js • Why node.js? • Socket I.O.
  • 39. Server Side • Node.js • heroic • socketIO • wesocket npm • Choose a solution what you want
  • 40. Server Side • Node.js • Step 0. Install the NodeJS • http://nodejs.org • Step 1. Node.js • console.log(“Hello World”);
  • 41. Server Side • Node.js (Express) • Step 2. create package JSON • Step 3. mkdir hello-world • Step 4. sudo npm install • Step 5. sudo npm install -g express-generator • Step 6. sudo npm install -g express -t ejs testApp • Step 7. npm start • Step 8 http://localhost:3000
  • 42. Server Side • Node.js • npm install --save socket.io • Example File: • http://expressjs.com • http://socket.io/get-started/chat/ • https://dl.dropboxusercontent.com/u/32940203/ simpleChat.zip
  • 43. Complete the works • Goal: • ⼤大家⼀一起合⼒力擊破⿎鼓,不斷的按按鈕,集氣的 概念,⼤大家⼀一起合⼒力不斷的按按鈕到⼀一定程度 就可成功擊破.
  • 44. Complete the works • End. • https://www.facebook.com/jerromy • jerromy@corma.com.tw