Skip to content

Instantly share code, notes, and snippets.

@hieptl
Created September 13, 2022 10:33
Show Gist options
  • Save hieptl/94b260b874cd82473d49e9ad142aaaab to your computer and use it in GitHub Desktop.
Save hieptl/94b260b874cd82473d49e9ad142aaaab to your computer and use it in GitHub Desktop.
Node.js Socket.io - chat.js - 1
/ FILE /client/chat.js
console.log('chat.js file loaded!')
// IMPORTANT! By default, socket.io() connects to the host that
// served the page, so we dont have to pass the server url
var socket = io.connect()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment