Skip to content

Instantly share code, notes, and snippets.

@vinnyoodles
Last active December 25, 2016 03:44
Show Gist options
  • Save vinnyoodles/576979b73ebfefce6de40681b219eb1f to your computer and use it in GitHub Desktop.
Save vinnyoodles/576979b73ebfefce6de40681b219eb1f to your computer and use it in GitHub Desktop.
React Native Socket.io Initial Server
var express = require('express');
var http = require('http')
var socketio = require('socket.io');
var app = express();
var server = http.Server(app);
var websocket = socketio(server);
server.listen(3000, () => console.log('listening on *:3000'));
// The event will be called when a client is connected.
websocket.on('connection', (socket) => {
console.log('A client just joined on', socket.id);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment