node.js インストールで socket.io が正常に実行されています。
info - socket.io started
コンソールは正常に実行されていることを示していますが、クライアント (ブラウザー) が接続するとすぐに:
socket = io.connect('<my host>:8000');
コンソールはエラーを吐き出しています:
crypto.js:123
return new Hash(hash);
^
TypeError: undefined is not a function
at Object.createHash (crypto.js:123:10)
at WebSocket.onSocketConnect (/node_modules/socket.io/lib/transports/websocket/hybi-16.js:120:23)
at WebSocket.handleRequest (/node_modules/socket.io/lib/transport.js:71:10)
at WebSocket.Transport (/node_modules/socket.io/lib/transport.js:31:8)
at new WebSocket (/node_modules/socket.io/lib/transports/websocket/hybi-16.js:59:13)
at new WebSocket (/node_modules/socket.io/lib/transports/websocket.js:31:17)
at Manager.handleClient (/node_modules/socket.io/lib/manager.js:661:19)
at Manager.handleUpgrade (/node_modules/socket.io/lib/manager.js:618:8)
at Server.<anonymous> (/node_modules/socket.io/lib/manager.js:123:10)
at Server.emit (events.js:88:20)
誰でもこれが何を意味するのか理解できますか?
私のコードはローカル マシンで正常に動作していますが、このエラーが発生するのは、コードを本番サーバーに移動したときだけです。