如何修复来自节点端socket.io的双重响应?

时间:2019-06-07 14:34:17

标签: node.js reactjs socket.io

我尝试使用react.js,socket.io和node.js创建一个简单的聊天应用程序。一切都很好,但是每次发送消息时,我都会得到下一个响应:

<iframe _ngcontent-c8="" frameborder="0" height="300" width="100%" src="http://146.250.180.213/grafana/dashboard-solo/script/script_graph.js?scenario_id=rrc_succ_rate&amp;cell_id=ESICAS23B_ESICAS23&amp;refresh=5s&amp;orgId=1&amp;panelId=4&amp;from=1555045266010&amp;to=1555168469864&amp;var-cell_id=ESICAS23B_ESICAS23&amp;var-scenario_id=ESICAS23B_ESICAS23"></iframe>

您能帮我解决此错误吗? 您可以在此处找到完整的代码:https://github.com/zhurbeyaleksander/second-chat

message: 'Hi' id: 1 
------------------------
message: 'Hi' id: 1 
message: 'how are you' id:2
message: 'how are you' id:2
-----------------------------
message: 'Hi' id: 1
message: 'how are you' id:2
message: 'how are you' id:2
message: 'th. How are you?' id:3
message: 'th. How are you?' id:3
message: 'th. How are you?' id:3
-----------------------------------

0 个答案:

没有答案