This is a brand new LiveReload in version 2.0.0.
Livereload-server LiveReload 2.x-3.x web socket / http server JavaScript MIT 9 19 1 2 Updated Jun 19, 2016. Livereload-stats LiveReload statistics analyzer. The full source code of LiveReload 2 is available on GitHub: LiveReload2 (Mac on master branch, Windows on node branch), livereload-plugins, livereload-js, livereload-extensions. Because curiosity is the most basic and important quality of good developers. I believe that everyone benefits from being able to study and tinker with other. LiveReload only monitors the local file system, so the code you edit has to be there somehow. Enable “Override URLs to serve modified CSS from localhost” in monitoring options. Also configure “Wait X seconds before doing a full page reload” with an appropriate delay. This supports Espresso, Sublime SFTP plugin and similar.
![Livereload Livereload](https://www.tutorialspoint.com/babeljs/images/babel_command.jpg)
This protocol is in use by production versions of LiveReload 2, LiveReload browser extensions 2.x and rack-livereload. The older protocol v6 is deprecated, and its support will be removed as soon as critical players (guard-livereload) upgrade to v7. LiveReload server MUST speak web sockets and HTTP on the same port. 81 9 9 bronze badges. I'm trying to use Livereload using Gulp, Sublime Text 3 and Chrome but for some reason it doesn't work. Here is what I did.
Installation¶
Python LiveReload is designed for web developers who know Python.
Install Python LiveReload with pip:
If you don’t have pip installed, try easy_install:
Command Line Interface¶
Python LiveReload provides a command line utility,
livereload
, for starting a server in a directory.By default, it will listen to port 35729, the common port for LiveReload browser extensions.
Older versions of Python LiveReload used a
Guardfile
to describe optional additional rules for files to watch and build commands to run on changes. This conflicted with other tools that used the same file for their configuration and is no longer supported since Python LiveReload version 2.0.0. Instead of a Guardfile
you can now write a Python script using very similar syntax and run it instead of the command line application.Script example: Sphinx¶
Here’s a simple example script that rebuilds Sphinx documentation:
Run it, then open http://localhost:5500/ and you can see the documentation changes in real time.
Developer Guide¶
The new livereload server is designed for developers. It can power awsgi application now:
The
Server
class accepts parameters:- app: a wsgi application
- watcher: a watcher instance, you don’t have to create one
server.watch¶
server.watch
can watch a filepath, a directory and a glob pattern:You can also use other library (for example: formic) for more powerfulfile adding:
You can delay a certain seconds to send the reload signal:
server.serve¶
Setup a server with
server.serve
method. It can create a static serverand a livereload server:shell¶
The powerful
shell
function will help you to execute shell commands. Youcan use it with server.watch
:Frameworks Integration¶
Livereload can work seamlessly with your favorite framework.
Django¶
For Django there is a management command included.
To use simply
- add
'livereload'
to yourINSTALLED_APPS
and - then run
./manage.pylivereload
.
For available options like host and ports please refer to
./manage.pylivereload-h
.To automagically serve static files like the native
runserver
command you have to use dj-static. (follow the simple instructions there).Flask¶
Wrap Flask with livereload is much simpler:
Bottle¶
Wrap the
Bottle
app with livereload server:API¶
livereload.
Server
(app=None, watcher=None)[source]¶Omni recover 2 7 1 – iphone data recovery software. Livereload server interface.
Initialize a server and watch file changes:
Parameters: |
|
---|
serve
(port=5500, liveport=None, host=None, root=None, debug=None, open_url=False, restart_delay=2, open_url_delay=None, live_css=True)[source]¶Start serve the server with the given port.
![Livereload Livereload](https://i.ytimg.com/vi/b4rTPplOCpE/hqdefault.jpg)
Parameters: |
|
---|
watch
(filepath, func=None, delay=None, ignore=None)[source]¶Add the given filepath for watcher list.
Once you have intialized a server, watch file changes beforeserve the server:
Parameters: |
|
---|
livereload.
shell
(cmd, output=None, mode='w', cwd=None, shell=False)[source]¶Execute a shell command.
You can add a shell command:
Parameters: |
|
---|
Changelog¶
Livereload 2 3 81 Resz
The full list of changes between each Python LiveReload release.
- Changelog
Contact¶
Livereload 2 3 81 Equals
Have any trouble? Want to know more?
- Follow me on GitHub for the latest updates.
- Follow me on Twitter (most tweets are in Chinese).
- Send Email to me.
This protocol describes the communication between a LiveReload server (LiveReload 2, rack-livereload, guard-livereload etc) and the client (livereload.js script, livereload browser extensions or whoever else may choose to connect).
Status
This protocol is in use by production versions of LiveReload 2, LiveReload browser extensions 2.x and rack-livereload.
The older protocol v6 is deprecated, and its support will be removed as soon as critical players (guard-livereload) upgrade to v7.
Basics
- LiveReload server MUST speak web sockets and HTTP on the same port. The port number SHOULD be 35729. Web socket connections MUST use
/livereload
as the path to connect to (e.g.ws://localhost:35729/livereload
).
HTTP protocol
Livereload 2 3 81 Epizoda
- LiveReload server MUST serve livereload.js (or another similar script implementing the client side of this protocol and compatible with URI options that livereload.js accepts) on HTTP path /livereload.js of the web sockets port.
Livereload 2 3 81 =
Web Socket Protocol
- Every web socket message MUST be a JSON object with a
command
key (a string). - Upon connection, a handshake takes place:
- Each party MUST send a ‘hello’ message immediately upon connection, and MUST NOT send any other messages before receiving a ‘hello’ message from the other party.
- The ‘hello’ message MUST specify a list of protocol URLs that the party wants to speak.
- Each protocol URL MUST be globally unique, and MUST point to an HTML or text document either describing the protocol itself or referencing the related product.
- After sending and receiving a ‘hello’ message, the parties implicitly agree to speak the intersection of the protocols they mentioned, picking the latest versions supported by both parties.
- If the intersection of the protocols is unsuitable to a party, it MUST close the web socket connection.
- Each command MUST be defined by one of the negotiated protocols. Each JSON object MUST conform to all negotiated protocols; in particular, this means it MUST only contain keys defined by some of the negotiated protocols, and MUST NOT use any other keys. (A particular vendor can always define its own freeform protocol if it wants to use random unspecified keys. Point is that unless such a protocol is negotiated, no additional keys are permitted.)
- Handshake, client-to-server.{ command: ‘hello’, protocols: [ ‘http://livereload.com/protocols/official-7’, ‘http://livereload.com/protocols/official-8’, ‘http://livereload.com/protocols/2.x-origin-version-negotiation’], }`</pre> Pdf reader online.
- Handshake, server-to-client:
- HELLO message may contain additional fields according to one of the protocols described in it. Thus any unknown fields MUST be ignored. This is an exception to the general rule, and should be used sparingly. Excentro 1 9 26 download free.
Official Protocol Version 7
Here’s a proposal of a protocol calledhttp://livereload.com/protocols/official-7
(previous protocols were called1.1
–1.6
after LR versions, so we’re starting with 7 to avoid confusion). - URL update, client-to-server:
- Reload request, server-to-client:
- Alert request, server-to-client, can be used by console servers to announce important things (like ‘Upgrade your browser extension!’) to the user.