2

I am trying to run guard-livereload on my Codio box.

The problem is when ever I "run" the project I get a CONNECTION_REFUSED error in my browser console.

I am not sure what is doing this as I have changed the port into the Codio range and set the file to watch for PHP files:

# A sample Guardfile
# More info at https://github.com/guard/guard#readme

guard 'livereload', :port => '4000' do
  watch(%r{.+\.(css|js|html|php)$})
end

I also have included this file in all my pages:

<script type="text/javascript" src="http://0.0.0.0:4000/livereload.js"></script>

When I run guard it is waiting for a browser to connect.

Otis Wright
  • 1,980
  • 8
  • 31
  • 53

1 Answers1

2

In codio box you have a domain name associated with your project: .codio.io, you can find it in IDE menu Project->Box Info. You should use it in your client code to include the livereload.js file. example (my bo domain is rebold-bogard):

<script type="text/javascript" src="http://rebold-bogard.codio.io:4000/livereload.js"></script>

0.0.0.0 address is for binding on server side. By default guard binds 0.0.0.0, this mean nothing to change here, only think you should be mind of is a notification library, you should use libnotify to track codio changes.

Maksimka
  • 71
  • 2
  • Did try this, unfortunately I receive this error: ``Failed to load resource: the server responded with a status of 404 (Not Found)`` Have you got this working on your box? – Otis Wright Nov 19 '14 at 08:18
  • Yes I had it working. but I had troubles with file watchers notification libraries. it didn't track changes from nano or codio, only from vim. Try grunt it worked for me fine for nodejs development. – Maksimka Nov 20 '14 at 08:54