Socket.io Official Chat application not work on firebase

两盒软妹~` 提交于 2019-12-02 06:34:32

问题


I deploy the Socket.io Official Chat application on Firebase, but it always show https://.firebaseapp.com/socket.io/ [HTTP/1.1 404 Not Found] in the console. How to fix this problem?? And It works on my local machine http://localhost:3000

Should I change var http = require('http').Server(app); to var http = require('https').Server(app); Because Firebase Hosting is SSL-only.

Any help would be much appreciated. Best Regards.


回答1:


Firebase Hosting is for static assets only. You cannot run your own node scripts on its servers. This means there is no way to run the socket.io chat app on Firebase Hosting.

Fun fact: Firebase also offers a real-time database, which can be used to very easily build a chat application. Have a look at the interactive tutorial to get a feel for it.



来源:https://stackoverflow.com/questions/33541884/socket-io-official-chat-application-not-work-on-firebase

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