Skip to content

Instantly share code, notes, and snippets.

@raucao
Created February 23, 2014 10:19
Show Gist options
  • Save raucao/9169605 to your computer and use it in GitHub Desktop.
Save raucao/9169605 to your computer and use it in GitHub Desktop.
<!-- @if dist=false -->
<script>
var script1 = document.createElement('script');
var script2 = document.createElement('script');
var body = document.getElementsByTagName("body")[0];
script1.src = '//'+window.location.hostname+':3000/socket.io/socket.io.js';
script2.src = '//'+window.location.hostname+':3001/client/browser-sync-client.0.6.0.js';
script1.onload = function() {
window.___socket___ = io.connect('//'+window.location.hostname+':3000');
body.appendChild(script2);
};
body.appendChild(script1);
</script>
<!-- @endif -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment