Django & node.js : throw arguments[1]; // Unhandled 'error' event

本小妞迷上赌 提交于 2019-12-23 17:52:04

问题


I am giving a try to the Django socket.io and node.js example by Realtime Django

when I am trying to send the message from a browser I am getting the error from node server that is

events.js:71
        throw arguments[1]; // Unhandled 'error' event
                       ^
Error: connect ECONNREFUSED
    at errnoException (net.js:770:11)
    at Object.afterConnect [as oncomplete] (net.js:761:19)

Since I started with node.js and socket.io I am not able to figure out this error.

Please tell me what might I am doing wrong.

Also some suggest some working example of django, node.js and socket.io if possible.


回答1:


the example uses redis as database backend, and the node redis-client. do you have installed the redis database? it looks like this is the problem.

if you have, the redis-client module provides an optional option param where you can define host, port etc... in your createClient (if you dont have installed redis the standard way):

var sub = redis.createClient(...maybe put an options object here...);


来源:https://stackoverflow.com/questions/14640741/django-node-js-throw-arguments1-unhandled-error-event

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!