From 177a52445015cd6b2f9a02e6f971c0af7e81d955 Mon Sep 17 00:00:00 2001 From: david Date: Mon, 1 Oct 2018 18:09:27 +0200 Subject: [PATCH] added default path option in socketTest server --- socketTest/index.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/socketTest/index.js b/socketTest/index.js index c917f91..6fc9c8f 100644 --- a/socketTest/index.js +++ b/socketTest/index.js @@ -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){ @@ -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);