Skip to content
This repository has been archived by the owner on May 5, 2020. It is now read-only.

Commit

Permalink
added default path option in socketTest server
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidSingh3 committed Oct 1, 2018
1 parent 48965be commit 177a524
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions socketTest/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
var app = require('express')();
var http = require('http').Server(app);
var io = require('socket.io')(http);
var options = {
path: '/socket.io', // this is the default path but can be changed to anything
}
var io = require('socket.io')(http, options);
const path = require('path')

app.get('/', function(req, res){
Expand Down Expand Up @@ -66,7 +69,7 @@ function startIntervals () {

var nsp = io.of('/asd');
nsp.on('connection', function(socket){
console.log('someone connected');
console.log('someone connected on /asd');
socket.on('chat message', function(msg){
console.log('message: ' + msg);
nsp.emit('chat message', msg);
Expand Down

0 comments on commit 177a524

Please sign in to comment.