Yet another implementation of the LiveReload server in Node.js.
This server makes browsers reload via the HTTP request.
Install:
$ npm install livereload-hub
Run the server:
$ livereload-hub
Connect to the server:
Install and enable LiveReload plugin on your browser
Send request for reloading:
$ curl your-livereload-hub.example.com:35729
-p, --port <number>
-a, --api-version <version>
--log-level fatal|error|warn|info|debug
--log-file <filename>
Use this option when you don't use name based virtual host.
--disable-host-header-matching
This server compare the host header, and reload only if the server received same header.
You can customize this server by using "livereload-hub" as a library.
# simple server
livereload_hub = require('livereload-hub')
server = livereload_hub.createServer()
server.setOptions(
http_callback: (request, response) ->
message = JSON.stringify [ "refresh",
path: request.url
]
for key, c of @clients
c.connection.sendUTF message
response.writeHead 200
response.write 'OK'
response.end()
)
server.listen 35729
This software is distributed under the MIT license.
An implementation of the LiveReload server in Node.js. josh/node-livereload