revolunet / sublimetext-markdown-preview

markdown preview and build plugin for sublime text 2/3
MIT License
2.31k stars 362 forks source link

LiveReload connection aborted (Fix/Workaround) #160

Closed pewpeo closed 10 years ago

pewpeo commented 10 years ago

On Windows (8.1 x64) an with version 2.0.2 of Sublime Text LiveReload loses connection. This occurs in Chrome as well as is Firefox.

socket.error: [Errno 10053] An established connection was aborted by the software in your host machine

Error seems to come from adding .../livereload.js?snipver=1... to the HTML file.

Workaround/Fix:

Use LiveReload extension for Chrome or Firefox, which adds the necessary script environment, when enabled. For Chrome this would be something like:

<script src="http://127.0.0.1:35729/livereload.js?ext=Chrome&amp;extver=2.0.9"></script>

and uncomment the following in MarkdownPreview.py.

if livereload_installed:
    html += '<script>document.write(\'<script src="http://\' + (location.host || \'localhost\').split(\':\')[0] + \':35729/livereload.js?snipver=1"></\' + \'script>\')</script>'
Stofkn commented 10 years ago

Thanks! Worked for me.

Maybe add it to the Markdown Preview Package Settings?