Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
node.js:无法从根目录请求socket.io_Socket.io - Fatal编程技术网

node.js:无法从根目录请求socket.io

node.js:无法从根目录请求socket.io,socket.io,Socket.io,对不起,我的英语不好 我有一个clientfile chat.html。代码以以下内容开头: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <script src="socket.io-client.js"></script>

对不起,我的英语不好

我有一个clientfile chat.html。代码以以下内容开头:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html> 
<head> 

<script src="socket.io-client.js"></script> 

<script type="text/javascript"> 
//mit dem Chatserver verbinden:
var socket = io.connect("http://test01.my-wan.de:8080"); 

//mit dem CHATSERVERBINDEN:
变量套接字=io.connect(“http://test01.my-wan.de:8080"); 
在浏览器的控制台上,我收到了“无法从root请求socket.io”。 文件socket.io-client.js与文件chat.html位于同一目录下。 我已经读了很多关于这个问题的帖子,但是我不能解决这个问题。
有人能帮我吗???谢谢

您从哪里获得客户端文件的

我刚才问了一个类似的问题,因为Socket.IO在这一点上含糊不清。这个问题似乎与我在这里的帖子重复:


问题的答案是服务器端的Socket.IO会自动放置客户端文件,因此您不必手动放置它。这方面的说明在他们网站的第一页。

您是否遵循了他们的说明?谢谢!!我很高兴,它起作用了。稍后我会在这里发布代码。太好了!是我的建议修好的吗?如果是这样,如果你不介意,请记住将答案标记为已接受。