Connecting client to server using Socket.io

前端 未结 2 504
情深已故
情深已故 2021-01-29 22:18

I\'m relatively new to node.js and it\'s addons, so this is probably a beginnersquestion.

I\'m trying to get a simple HTML page on a webserver connect to a different ser

2条回答
  •  情书的邮戳
    2021-01-29 22:23

    You need to make sure that you add forward slash before your link to socket.io:

    
    

    Then in the view/controller just do:

    var socket = io.connect()
    

    That should solve your problem.

提交回复
热议问题