Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
layout.vash com script conectando com o
<!DOCTYPE html>
<link rel='stylesheet' href='/stylesheets/style.css' />
@if (process.env.NODE_ENV !== 'prodution') {
<script src="/"></script>
var waitingToReconnect = false;
var socket = io(;
socket.on('connect', function () {
if (waitingToReconnect)
socket.on('disconnect', function () {
waitingToReconnect = true;
* This code is more efficient, you can use this too instead of above.
* But it makes browser stop displaying page if the server goes down.
io('disconnect', function(){
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment