According to the grunt-contrib-connect guide when using onCreateServer function you should run this with grunt connect command, so if I add connect in my grunt serve task like this:
It says that "Fatal error: Port 9000 is already in use by another process.". So I want to know is it possible to use socket.io with livereload or not? If yes what's good practice to do it?
Okay, found the solution. It seemed my code was correct and socket.io at onCreateServer function can actually listen properly the server that is running.
I'm currently having a project that runs with
grunt serve
command.serve
is defined like this in myGruntfile.js
I setup socket.io using
onCreateServer
function like this (server options under connect object):According to the grunt-contrib-connect guide when using
onCreateServer
function you should run this withgrunt connect
command, so if I addconnect
in mygrunt serve
task like this:It says that "Fatal error: Port 9000 is already in use by another process.". So I want to know is it possible to use socket.io with livereload or not? If yes what's good practice to do it?