Skip to content

Instantly share code, notes, and snippets.

@mutsune
Created September 21, 2018 15:21
Show Gist options
  • Save mutsune/a2a139211447daaf118f604cc7d73c78 to your computer and use it in GitHub Desktop.
Save mutsune/a2a139211447daaf118f604cc7d73c78 to your computer and use it in GitHub Desktop.
minimum socket-io
const socketio = require('socket.io-client')
const socket = socketio('http://localhost:8888');
socket.on('update', d => console.log(d));
socket.on('dynamo', d => console.log(d));
// socket.on('connect', function(){});
// socket.on('event', d => console.log(d));
// socket.on('disconnect', function(){});
{
"name": "minimum_socket_io",
"version": "1.0.0",
"description": "",
"main": "client.js",
"dependencies": {
"socket.io-client": "^2.1.1"
},
"devDependencies": {},
"scripts": {
"start": "node client.js"
},
"author": "",
"license": "ISC"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment