使用 Flash 界面进行基于文本的一对一聊天:后端的动力是什么?

发布于 2024-08-30 01:52:37 字数 409 浏览 2 评论 0原文

我正在建立一个网站,将人们联系起来,以便他们可以匿名向陌生人发泄。你要么选择成为一个倾听者,要么成为一个谈话者,然后你就会进入一对一的聊天室。

构建该应用程序的原因是因为您通常无法向朋友发泄,因为您最深层的漏洞往往会在以后被利用。 (无论喜欢与否,这是人性的一部分。悲伤。)

我正在寻找一些关于我应该如何构建一切的见解。我发现了这个简洁的教程,http://giantflyingsaucer.com/blog/?p=875,建议使用 python &无堆栈+闪存。其他人建议我应该尝试使用 p2p 套接字,但我什至不知道从哪里开始寻找相关信息。

还有其他建议吗?我想保持简单。 :^)

I'm building a website where I hook people up so that they can anonymously vent to strangers. You either choose to be a listener, or a talker, and then you get catapulted into a one-on-one chat room.

The reason for the app's construction is because you often can't vent to friends, because your deepest vulnerabilities can often be leveraged against you later on. (Like it or not, this is a part of human nature. Sad.)

I'm looking for some insight into how I should architect everything. I found this neat tutorial, http://giantflyingsaucer.com/blog/?p=875, which suggests using python & stackless + flash. Someone else suggested I should try using p2p sockets, but I don't even know where to begin to look for info on that.

Any other suggestions? I'd like to keep it simple. :^)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

匿名。 2024-09-06 01:52:37

除非您期望超高负载,否则这很简单,您在后端使用什么并不重要:只需选择您喜欢的东西即可。 PHP、Python、Ruby,甚至是使用 CGI 的 bash 脚本 - 您对该语言的技能水平可能会比该语言本身的功能产生更大的影响。

Unless you expect super high load, this is simple enough that it doesn't really matter what you use on the backend: just pick something you're comfortable with. PHP, Python, Ruby, Even a bash script using CGI - your skill level with the language is likely to make more difference that the language features themselves.

你的笑 2024-09-06 01:52:37

我会使用 XMPP 服务器,例如 ejabberdOpenFire 为后端提供动力。 XMPP 包含创建聊天/实时应用程序所需的一切。您可以使用 Flex/Flash Actionscript 库(例如 Actionscript 3 XIFF)与 XMPP 服务器进行通信。

I would use an XMPP server like ejabberd or OpenFire to power the backend. XMPP contains everything you need for creating chat/real-time applications. You can use a Flex/Flash Actionscript library like Actionscript 3 XIFF to communicate with the XMPP server.

深空失忆 2024-09-06 01:52:37

Flash 对于 UI(表单等)来说对用户不友好,并且在前端使用 HTML 和 Javascript 来完成您想要的操作相对容易。

读取消息的一种可能方法是定期从服务器发出 Ajax 请求以获取任何新消息。设置新消息的格式并将其插入到 DOM 中。

不过,在继续之前,您可能至少需要回答以下问题:

1) 您是否正在重新创建 IRQ(每个人都可以看到您的帖子),或者这是随机的一对一聊天,例如聊天轮盘?

1a) 这是特定人与另一个特定人交谈的方式,还是更像 Twitter?

2)如果这个想法成功,你有什么扩大规模的计划? Memcached 可能应该是最后的手段(“弹孔上的创可贴”)。最终处理大量消息的路线图是什么?

3)有什么办法可以忽略用户吗?与某些用户交谈?对用户隐藏你的咆哮?

Flash is user-unfriendly for UI (forms, etc) and it is relatively easy to do what you want using HTML and Javascript on the front-end.

One possible approach for reading the messages would be to regularly do an Ajax request from the server for any new messages. Format the new message and insert it into the DOM.

You will probably need to answer at least these questions before you continue, though:

1) Are you recreating IRQ (everyone sees your posts), or is this a random one-to-one chat, like chatroulette?

1a) Is this a way for a specific person to talk to another specific person, or is this more like twitter?

2) What is your plan for scaling up if this idea takes off? Memcached should probably be a method of last-resort ("bandaid over a bullet-hole"). What's your roadmap for eventually handling a large volume of messages?

3) Is there any way to ignore users? Talk to certain users? Hide your rants from users?

与往事干杯 2024-09-06 01:52:37

嘿,扎克,我必须为我制作的 Flash 游戏创建一个套接字服务器。我用 C# 构建了我的服务器,但我会使用您熟悉的任何语言。如果您让我知道您最喜欢什么,我可以尝试帮助找到一个好的教程。

我花了很多时间做的一件事是让 flash 在带有套接字服务器的网站上工作。对于较新版本的 Flash,您需要发回策略文件。就我而言,这需要是当客户端连接到套接字服务器时发送回客户端的第一个数据块。

不知道该告诉您有关构建后端的内容。我需要更多地了解您的编程经验。我有一个所有用户连接的数组,并将它们放置在不同的“房间”中,以便他们可以互相玩。因此,只需一些简单的数组并了解如何向客户端发送消息就会对您有所帮助。

如果您熟悉 C#,我可以毫无问题地向您发送我的套接字服务器的源代码。

Hey Zach I had to create a socket server for a flash game I made. I built my server in C#, but I would use whatever language your familiar with. If you let me know what your most comfortable with I could try to help find a good tutorial.

The one thing I spent many hours on was getting flash to work from a website with a socket server. With the newer versions of Flash you need to send back a policy file. In my case this needed to be the first chunk of data sent back to the client when they connected to the socket server.

Not sure what to tell you about structuring the back end. I need to know a little bit more about your programming experience. I had an array of all user connections, and was placing them in different "Rooms" so they could play each other. So just some simple arrays and understanding how to send messages to the clients would help you here.

If you have any familiarity with C# I would have no problem sending you the source code for my socket server.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文