XMPP 服务器名称和 XMPP 服务名称之间的区别?
在Smack API中,有一个用于连接的配置类,在本页描述
我对服务名称和服务器名称之间的区别感到困惑。
假设我有一台名为“mybox.mydomain.com”的计算机,并且我在其上配置了 ejabberd,并配置了名为“myhost”的主机(使用行 {hosts, ["myhost"]}.
中ejabbed.cfg),
本例中的主机名、服务器名和服务名是什么?
In Smack API, there is a configuration class for connection, described at this page
I am confused about the distinction between service name and server name.
Suppose I have a computer named "mybox.mydomain.com", and I have ejabberd on it with a configured host called "myhost" (using the line {hosts, ["myhost"]}.
in ejabbed.cfg),
what is the host name, server name and service name in this case?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以在任何主机上托管 XMPP 域,前提是您在 DNS 中正确设置了 SRV 记录,或者客户端指定了它应该连接的主机(例如电子邮件)。
You can host an XMPP domain over any host, provided that you set the SRV records right in the DNS or if the client specifies to which host it is supposed to connect (like email).
想想您用于登录的 JID,其中包含
username
@domain
。domain
是您正在使用的服务的逻辑名称。对于某些服务,例如jabber.org
,该服务在与该服务同名的机器上运行。对于许多其他应用程序(如 WebEx Connect 和 GoogleTalk)来说,服务域是确定在何处打开套接字的起点,而不是机器的名称。如果一切设置正确,您可以使用 SRV 在 DNS 中查找要连接的计算机的名称记录。例如,使用 dig:如果在 DNS 中未正确配置服务域,或者您只是进行测试,则能够与域分开指定此连接主机通常很有用。因此,对于您的示例,您将使用:
如果您希望网络外的人员(客户端到服务器或服务器到服务器)访问此服务,则将您的服务域重命名为完全限定的东西,您可以附加 SRV 记录以供这些外部实体使用。
Think of the JID you're using to log in, which contains
username
@domain
. Thedomain
is the logical name of the service you are using. For some services, likejabber.org
, the service is run on a box that has the same name as the service. For many others, like WebEx Connect and GoogleTalk, the service domain is a starting point to figure out where to open a socket to, but not the name of the machine. If everything is set up right, you can look up the name of the machine to connect to in the DNS using an SRV record. For example, using dig:If the service domain is not configured correctly in the DNS, or you're just testing things out, it's often useful to be able to specify this connect host separately from the domain. So for your example, you would use:
If you ever want this service to be accessed by people off of your network (either client-to-server or server-to-server), it would make sense to rename your service domain to be something fully-qualified, to which you can attach SRV records for those external entities to use.