duanlei1957 2017-02-08 13:31
浏览 435

带有websocket和cloudflare的Node.js无法正常工作

I have two node scripts connected with PHO site. Domain is under Cloudflare protection.

I using node.js and socekt.io to update content live to all connected users, but when I using CF protection, node script not working well.

Could someone tell me what I should do? My ports: 8880 and 8080.

  • 写回答

1条回答

  • dongque8332 2017-03-30 15:08
    关注

    You need allow CORS from your node script add the following to your node script for socket.io.

    io.set('origins', 'http://sampledomain.com:8880');

    评论

报告相同问题?

悬赏问题

  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号
  • ¥50 安装pyaudiokits失败
  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能
  • ¥15 jmeter脚本回放有的是对的有的是错的
  • ¥15 r语言蛋白组学相关问题
  • ¥15 Python时间序列如何拟合疏系数模型