Most web-based chat apps I've seen are a combination of server-side code (of various flavors) and client-side javascript. On balance I'd say it doesn't matter what you use on the server side, go with what you know.
The answer is that you can use any language you want on the server side, just like any other programming exercise. Really.
You'll save yourself a lot of time and headaches if you use something that's already been written, though. XMPP (and any decent XMPP server) has a web interface built in to the protocol, and any decent server implements it.
On the client, I use a JavaScript library called Strophe to connect. There's also JSJaC, extracted from a pre-built open-source web chat client called JWChat.
发布评论
评论(4)
我见过的大多数基于网络的聊天应用程序都是服务器端代码(各种风格)和客户端 JavaScript 的组合。总的来说,我想说,您在服务器端使用什么并不重要,只要使用您所知道的即可。
Most web-based chat apps I've seen are a combination of server-side code (of various flavors) and client-side javascript. On balance I'd say it doesn't matter what you use on the server side, go with what you know.
您可能想查看 Node.js。它是服务器端 javascript,因此与客户端 javascript 通信更容易。
事实上,他们有一个聊天演示以及源代码。
Node.js 就是为这种类型的事情而设计的。我会推荐它。
You might want to check out Node.js. It is server-side javascript, so it's easier to communicate with client-side javascript.
As a matter of fact, they have a chat demo here along with the source code.
Node.js is MADE for this type of thing. I'd recommend it.
答案是,您可以在服务器端使用任何您想要的语言,就像任何其他编程练习一样。真的。
不过,如果您使用已经编写好的东西,您会节省大量时间并避免头痛。 XMPP(以及任何像样的 XMPP 服务器)都有一个协议内置的 Web 界面,任何像样的服务器都可以实现它。
在客户端上,我使用名为 Strope 的 JavaScript 库进行连接。还有 JSJaC,从名为 JWChat。
这应该可以帮助您开始。
The answer is that you can use any language you want on the server side, just like any other programming exercise. Really.
You'll save yourself a lot of time and headaches if you use something that's already been written, though. XMPP (and any decent XMPP server) has a web interface built in to the protocol, and any decent server implements it.
On the client, I use a JavaScript library called Strophe to connect. There's also JSJaC, extracted from a pre-built open-source web chat client called JWChat.
This should get you started.
实际上,为了获得最好的 UI,您可以使用 Silverlight,利用强大的 .NET 的力量。你知道,这是 C#。
Actually for the best UI you can use Silverlight, by using the power of mighty .NET. It's C# you know.