LoginSignup
2
2

More than 5 years have passed since last update.

socket.ioをherokuで動かす時の注意メモ

Posted at
heroku --verion : heroku-toolbelt/3.9.6 (x86_64-darwin10.8.0) ruby/1.9.3
node -v : v0.10.30
npm -v : 1.4.21
express --version : 4.2.0

socket通信のところで上手く挙動ができていないと思ったらコンソールに以下のエラーを吐いていました。

スクリーンショット 2014-08-11 16.04.17.png

意味不明だったのでおもむろに検索をかけてみるとヒットしたのが以下の記事

問題はindex.ejsの中で

var socket = io.connect('http://localhost:3000');

ともろにlocalhostと書いてしまっていたのが原因でした。

「It's a stupid error」
まさにその通り・・・

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2