{"size": 909, "ext": "js", "max_stars_repo_path": "server/config/socketio.js", "max_stars_repo_name": "daton89/nodejs-cluster-socket.io", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "server/config/socketio.js", "max_issues_repo_name": "daton89/nodejs-cluster-socket.io", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "server/config/socketio.js", "max_forks_repo_name": "daton89/nodejs-cluster-socket.io", "max_forks_repo_forks_event_min_datetime": "2021-02-24T08:15:41.000Z", "max_forks_repo_forks_event_max_datetime": "2021-02-24T08:15:41.000Z"}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 22.725, "max_line_length": 115, "alphanum_fraction": 0.6611661166}
/**
 * Socket.io configuration
 */

'use strict'

module.exports = function (io) {
	// socket.io (v1.x.x) is powered by debug.
	// In order to see all the debug output, set DEBUG (in server/config/local.env.js) to including the desired scope.
	//
	// ex: DEBUG: "http*,socket.io:socket"

	// We can authenticate socket.io users and access their token through socket.decoded_token
	//
	// 1. You will need to send the token in `client/components/socket/socket.service.js`
	//
	// 2. Require authentication here:
	// io.use(require('socketio-jwt').authorize({
	//   secret: config.secrets.session,
	//   handshake: true
	// }));

	io.on('connection', function (socket) {

		// Call onDisconnect.
		socket.on('disconnect', () => {
			console.log('DISCONNECTED')
		})

		// Insert sockets below
		socket.on('chat message', function (msg) {
			io.emit('chat message', msg)
		})


		console.log('CONNECTED')

	})
}
