Javascript socket.io 的初学者教程?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4094350/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-23 10:35:24  来源:igfitidea点击:

Good beginners tutorial to socket.io?

javascriptnode.jshtmlwebsocketsocket.io

提问by Shouvik

I am very new to the world of webdevelopment and jumped into the bandwagon because I find the concept of HTML5 very interesting. I am fairly confident on working with canvas and would now like to move over to websockets part of it. I have come to understand socket.io is by far the framework to work with, when we want to work with web sockets.

我对 Web 开发世界非常陌生,并加入了这个潮流,因为我发现 HTML5 的概念非常有趣。我对使用画布相当有信心,现在想转移到它的 websockets 部分。当我们想要使用 Web 套接字时,我已经明白 socket.io 是迄今为止要使用的框架。

Any pointers on what tutorial and examples to refer to for a total dummy would be very appreciated!

任何关于完全虚拟的教程和示例的指示将不胜感激!

采纳答案by FR6

To start with Socket.IOI suggest you read first the example on the main page:

要从Socket.IO开始,我建议您先阅读主页上的示例:

http://socket.io/

http://socket.io/

On the server side, read the "How to use" on the GitHub source page:

服务器端,阅读GitHub源码页面的“使用方法”:

https://github.com/Automattic/socket.io

https://github.com/Automattic/socket.io

And on the client side:

客户端

https://github.com/Automattic/socket.io-client

https://github.com/Automattic/socket.io-client

Finally you need to read this great tutorial:

最后,您需要阅读这个很棒的教程:

http://howtonode.org/websockets-socketio

http://howtonode.org/websockets-socketio

Hint: At the end of this blog post, you will have some links pointing on source code that could be some help.

提示:在这篇博文的结尾,您将获得一些指向源代码的链接,这些链接可能会有所帮助。

回答by 250R

A 'fun' way to learn socket.io is to play BrowserQuest by mozilla and look at its source code :-)

学习 socket.io 的一种“有趣”方式是玩 mozilla 的 BrowserQuest 并查看其源代码 :-)

http://browserquest.mozilla.org/

http://browserquest.mozilla.org/

https://github.com/mozilla/BrowserQuest

https://github.com/mozilla/BrowserQuest