#1 By: neuberfran, June 14th, 2014 19:11
I'm trying to put this application (http://googlecreativelab.github.io/coder-projects/projects/blinky_lights/) on heroku
e.g.:. this link (fierce-shelf-9252.herokuapp.com)
it already runs but when I click blink_ligths is only connecting, connecting ... I do not know the places that I have put the process.env.PORT
I have put, but not a few who have and websocket socket io javascrit files (js)
is it's ok ? (https://discussion.heroku.com/t/socket-io-working-locally-but-not-on-heroku/101/12)
(var socket = io.connect('http://xxxxxx.herokuapp.com');
var socket = io.connect(); -------------> is it's ok ??
Help me please
#3 By: dimabkup, July 6th, 2014 07:46
you can try to swap out socket.io components and throwing in plain ws --> the tutorial that heroku provides is failry straight forward https://github.com/heroku-examples/node-ws-test
the only thing that github version doesn't mention is --> heroku labs:enable websockets <-- after you create a new heroku project. The commit messg mentions that soon sockets will be enabled by default but I would still suggest enabling them via labs.
there are a couple of gotchas however. heroku will spin down your process after roughly a minute, so you have to ping every 30 sec or so from either the server or the client side.