Join Joseph LeBlanc for an in-depth discussion in this video What are WebSockets?, part of Node.js First Look.
Have you ever seen Facebook's chat feature and wondered how I can make something similar for my web site? Fortunately, WebSockets make it easier to add chat rooms, notification systems, and other real-time features than ever before. Node has tools ready to go to help you make the most of WebSockets quickly. So why are we using WebSockets? Traditionally, HTTP has been a stateless protocol. That means a web browser will connect to a web server, get the content, and then close the connection. This made it very difficult to do live features on a web site.
So now we have WebSockets. WebSockets are a bi-directional communication protocol between the server and browser. WebSockets use TCP instead HTTP. So that way you get around the statelessness of HTTP. WebSockets are native to the browsers that support it. There're no hacks, no iFrames, and no Flash used to implement WebSockets. However, the disadvantage with WebSockets is that it support for them is inconsistent. Not all web browsers support WebSockets and the ones that do don't support them in consistent ways.
Socket.io will automatically detect and use the best protocol. This chapter will use Node and Socket.io to create a chat room. Socket.io will take care of the connection between the browser and node which will allow us to focus on the chat functionality.
- Using the Socket.IO Node package to achieve "live" effects like Facebook notifications
- Scraping web sites using jQuery without a browser
Skill Level Beginner
XHTML and HTML Essential Trainingwith Bill Weinman4h 44m Beginner
1. Installing Node
2. Getting Started
Running a Node script2m 6s
4. Command Line Scripts
5. Creating Web Servers
7. WebSocket Programming
8. Connecting Beyond Node
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.