Socket.IO - require is not defined

后端 未结 8 2167
Happy的楠姐
Happy的楠姐 2020-12-28 08:49

I\'m trying to get socket.io working but now in Chrome I get the error:

Uncaught ReferenceError: require is not defined

client.php:9

8条回答
  •  情歌与酒
    2020-12-28 09:04

    I tried what thejh says and it works. I needed to specify the host and port. For a node app listening on port 81, I needed to specify port 81 in the client javascript. Nevermind /socket.io/socket.io.js doesn't exist in the vhost, node makes up for it at runtime.

提交回复
热议问题