Skip to content

the8thbit/react-tutorial-websockets

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Tutorial (websockets)

This is the React comment box example from the React tutorial adapted to use websockets (with flashsocket and xhr polling fallback) through socket.io instead of ajax polling. This is less code, less expensive, and more secure.

To use

The ajax version of this repository includes three different servers. Here, I only provide a websockets implementation of the node server. It serves static files from public/ and fetches/adds data through socket.io events. Start a server with:

npm install
node server.js

And visit http://localhost:3000/. Try opening multiple tabs!

About

Code adapted from the React tutorial to use websockets instead of ajax polling.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 85.7%
  • CSS 14.3%