我应该如何开始编写类似 Skype 的 Web 应用程序?
这是我正在参加的编程课程。我符合先决条件,这就是对 C++ 的深入了解。
澄清一下:这不应该是桌面应用程序的后端。该网站可以进行视频聊天、文件发送、文本聊天,所有这些都可以在浏览器中进行。
所以我没有网络开发经验。我以前玩过 PHP,也看过一本 JavaScript 书,感觉使用起来很舒服。我知道 MySQL 是什么以及如何设置表之类的东西。
我在接下来的 8 周内需要做的是:
- 进行视频聊天(2 人之间)
- 有一个登录页面,每个用户都有个人资料和联系人列表
- 文本聊天(2 人之间)
- 文件共享(2 人之间)
我愿意不知道用什么来实现这一点。我有一些想法,但我不确定它们是否真的有效。我可以使用开源库、程序、代码等来构建此 Web 应用程序。
如果有人可以引导我走向正确的方向,建议我应该如何实现这些功能,我将非常感激。
另外,当我一直在谷歌搜索并寻找如何做这样的事情时,我看到了一个叫做 CakePHP 的东西。你建议我用这个吗?如果是这样,我到底应该用它来做什么?
This is for a programming class I am taking. I fit the pre-requisites, which is just a strong knowledge in C++.
To clarify: This is not supposed to be a backend for a desktop application. The website does video chat, file sending, text chat, all in the browser.
So I have no web development experience. I have played with PHP before and looked at a JavaScript book and feel comfortable using them. I know what MySQL is and how to set up tables and stuff.
What I need to do in the next 8 weeks is:
- Get video chat working (between 2 people)
- Have a login page, each user has a profile and contact list
- Text chat (between 2 people)
- File Sharing (between 2 people)
I do not know what to use to accomplish this. I have some ideas, but I am not sure they would really work. I am allowed to use open sourced libraries, programs, code, etc. to build this web application.
If someone could steer me in the correct direction, suggest how I should implement these features I would really appreciate it.
Also while I have been googling and looking at how to do stuff like this, I saw something called CakePHP. Would you suggest I use this? If so, what exactly should I use it to do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你将需要大量的咖啡!
Skype 使用点对点和客户端/服务器方法的混合架构来获取数据。如果这仅在内部 LAN 上运行,则您不必担心中间的服务器,而可以专注于设置点对点连接。
在现实世界中,计算机通过 NAT 被路由器隐藏,Skype 使用服务器让您通过 NAT 登录并设置开放端口。然后 Skype 将此信息发送给您的其他对等方,并从那里运行点对点连接。
在内部网络上,您可以通过开放的UDP端口与其他人进行通信。 Skype 使用此协议而不是 TCP,而互联网上的许多其他通信都依赖于 TCP。基本上,您无法获得可靠的交付,并且两端的应用程序都会适应这一点。 (即,当数据包丢失或损坏时,您的视频会冻结一秒钟)
在弄清楚如何通过网络运行之后,您需要学习 Windows 图像采集 API,这是使用网络摄像头的标准方法获取静态图片。你连续拍够这些照片,宾果!您有一个乡巴佬视频流可以通过网络发送。
我认为 MySQL 可以与 PHP 发布的 SOAP Web 服务很好地配合来处理登录和联系人数据库...
为什么你称其为 Web 应用程序?它会在网络浏览器中运行吗?这只是一个网络应用程序,对吧?
还有一条建议...使用 C# 或其他 .NET 语言进行编程可能会有所帮助,因为您可以使用更多控件。例如,有一个 WIA 控件可以轻松地将视频流传输到您的应用程序中。
You are going to need lots of coffee!
Skype uses a hybrid architecture of peer-to-peer and client/server methods to get data around. If this is going to only be run on an internal LAN, you don't have to worry about the server in the middle and can focus on setting up just a peer-to-peer connection.
In real world, where computers are hidden by your router by something called NAT, Skype uses servers for you to log into and set up an open port through your NAT. Then Skype sends this information to your other peer, and a peer-to-peer connection runs from there.
On an internal network, you can just communicate with others through an open UDP port. Skype uses this as opposed to TCP, with much of your other communication on the internet relies on. Basically, you don't get reliable delivery, and the applications on both ends adapt to this. (ie. Your video freezes up for a second when packets get lost or destroyed)
After you figure out how you will run through the network, you need to learn the Windows Image Acquisition API, which is a standard way of working with a web camera to acquire a still picture. You take enough of this pictures in a row and BINGO! You've got a hillbilly video stream to send over the network.
I assume MySQL will work good with a PHP published SOAP webservice to handle the login and contact database...
Why are you calling this a web application? Will it run inside of a web browser? It's just a network application, right?
One more piece of advice... Programming this in C# or some other .NET language might be helpful because there are a lot more controls available to you. For instance, there is a WIA control that will easily pipe the video stream into your application.
我认为这些链接可能对您有用:
http://www.codeproject.com/ aspnet/webcamimage.asp
http://www.planet-source -code.com/vb/scripts/ShowCode.asp?txtCodeId=1339&lngWId=10
另外我建议您使用UDP连接,
并开发一些类似标头的简单原型
例如标头 0x01 表示下一个将是消息结构
0x02 表示下一个将是帧结构(视频的网络流)等等
I think these links might be useful for you:
http://www.codeproject.com/aspnet/webcamimage.asp
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=1339&lngWId=10
Also I suggest you to use UDP connection,
and develop some header-like simple proto
for example header 0x01 means that next will be message structure
0x02 that next will be a frame structure(web streaming of video) and so on