[jbosstools-issues] [JBoss JIRA] (TOOLSDOC-333) NeedInfo: How does LiveReload work?

Xavier Coulon (JIRA) jira-events at lists.jboss.org
Tue May 21 05:31:07 EDT 2013


     [ https://issues.jboss.org/browse/TOOLSDOC-333?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Xavier Coulon reassigned TOOLSDOC-333:
--------------------------------------

    Assignee: Michelle Murray  (was: Xavier Coulon)


Hi Michelle!

"The LiveReload server handles the server-side of the LiveReload action, such as sending request to refresh web pages. The browser extension handles the client-side of the LiveReload action, such as refreshing pages." is correct.

On the client side, the user install the LiveReload extension. Basically, when this extension is activated, a javascript file is injected at the bottom of the current HTML page. This scripts automatically attempts to connect http://localhost:35729 and then upgrades the HTTP connection to the websocket protocol. This means that the connection remains open and that the server can send messages to the browser anytime it needs to. BTW, this client-side part is something that already existed before and that is available at http://livereload.com

Then, on the server-side there is the Eclipse Plugin that I developed and that runs the LiveReload server. Once the LiveReload server is started, it received notification from the Eclipse Platform that some local file changed, and then sends a 'reload' message to the connected browsers. This message indicated the location of the file that just changed. If the file is a CSS, the livereload javascript just re-applies the styles to the HTML elements. Otherwise, it refreshes the whole page.

I also developed a 'proxy' server that removes the need to install the Browser extension. This proxy server acts as a 'man in the middle' and automatically injects the <script> tag at the bottom of the <body> element of returned HTML pages. Also, this proxy means that local files are accessed using the http:// protocol instead of the file:// protocol, which means that the workspace files can be accessed by external devices/computers. By default and for security reasons, this feature is disabled by default on the LiveReload server. Also, only workspace files are exposed by this proxy server.


Michelle, don't hesite to contact me again if this explanation was not clear enough for you. 
You may also want to watch https://www.youtube.com/watch?v=NGaHu4z_BLc if you want to see part of what I explained above in action... with my delicious French accent in background ;-)
                
> NeedInfo: How does LiveReload work?
> -----------------------------------
>
>                 Key: TOOLSDOC-333
>                 URL: https://issues.jboss.org/browse/TOOLSDOC-333
>             Project: Documentation for JBoss Tools and Developer Studio
>          Issue Type: Task
>      Security Level: Public(Everyone can see) 
>          Components: User Guide
>    Affects Versions: 4.1.0
>            Reporter: Michelle Murray
>            Assignee: Michelle Murray
>
> I am trying to document LiveReload Tools (integration of LiveReload in JBDS) and I have some questions about how it works.
> Users need a LiveReload server within the IDE and the LiveReload browser extension installed in Chrome or Firefox. Why are both needed? How is the work process distributed between the two? Which is responsible for which tasks?
> I ask because I could imagine the browser extension just looking for changes in file time stamps and consequently reloading pages. It clearly isn't as simple as that but I don't see how the LiveReload server fits in.
> Just read an email from Max to Burr, which separated functions into server-side and client-side. So does LiveReload work something like this: "The LiveReload server handles the server-side of the LiveReload action, such as sending request to refresh web pages. The browser extension handles the client-side of the LiveReload action, such as refreshing pages."

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jbosstools-issues mailing list