使用 javascript 聊天客户端 (jsjac) 连接到远程 jabber 服务器

发布于 2024-07-18 20:41:46 字数 364 浏览 1 评论 0原文

这更多的是一个概念性问题。

我正在尝试创建一个可以安装在任何任意页面(x.com 和 y.com)上的 Javascript jabber 客户端,并且我希望该客户端能够与远程 jabber 服务器(chatserver.com)进行通信)。

根据我正在查看的一个 javascript 客户端(jsjac)的自述文件,由于跨站点问题,它无法与远程服务器通信,这是 javascript 的固有限制。

我很乐意听取任何人关于如何克服这一障碍的意见。 指向示例的指针将非常有帮助。

[更新] 我在这里假设我无法控制客户端服务器 x.com 和 y.com。 Hab.la 的人们似乎已经成功实现了这一目标,但不知道是如何实现的。

This is more of a conceptual question.

I'm trying to create a Javascript jabber client that can be installed on any arbitrary page (on x.com and y.com), and I'd like this client to be able to communicate with a remote jabber server (chatserver.com).

According to the readme of one javascript client I'm lookign at (jsjac), it is an inherent limitation of javascript that it can't communicate with a remote server due to cross site issues.

I'd appreciate hearing from anyone about how to overcome this hurdle. A pointer to an example would be extremely helpful.

[Update] I'm assuming here that I have no control over x.com and y.com, the client servers. The folks at Hab.la seem to have pulled this off, not sure how.

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

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

发布评论

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

评论(1

淤浪 2024-07-25 20:41:46

解决此问题的最简单方法是通过托管客户端的服务器将请求从 JavaScript 客户端代理到远程服务器。

Apache 的 mod_proxy 扩展可以很好地处理这个问题。

The simplest way around this is to proxy the requests from the JavaScript client to the remote server, via the server that hosts the client.

Apache's mod_proxy extension handles this fine.

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