如何了解更多 XMPP/Jabber 命令

发布于 2024-09-04 04:48:35 字数 427 浏览 3 评论 0原文

我现在使用 ejabberd 作为聊天服务器。 我正在编写一个客户端来聊天和注册新用户。 现在,我知道注册新帐户的一些协议, 就像发送以下命令来注册新用户:

<iq type="set"><query xmlns="jabber:iq:register"><username>wfwfewegwegwewefg</username><password>wfwefwefwefwef</password></query></iq>

我的问题是: 我想了解更多与服务器通信的命令/协议。 那么我可以在哪里了解更多信息呢? 例如,如何询问服务器用户名是否存在。 如何要求服务器注销用户。

我应该搜索的关键词是什么? 我应该搜索 Jabber XMPP 协议还是什么?

I am using ejabberd as a chatting server now.
And I am writing a client to chat and register new user.
Right now, I know some of the protocol to register a new account,
like sending the following command to register new user:

<iq type="set"><query xmlns="jabber:iq:register"><username>wfwfewegwegwewefg</username><password>wfwefwefwefwef</password></query></iq>

My question is:
I want to learn more command/protocol to talk to the server.
So where can I learn more?
For example, How can I ask the server if the user name exists or not.
How can I ask the server to unregister a user.

What is the key word I should search for?
Should I search for Jabber XMPP protocol or what?

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

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

发布评论

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

评论(3

一个人的旅程 2024-09-11 04:48:35

如果您从管理员帐户发送查询来执行这些操作,请查看 XEP-0133:服务管理,它基于XEP-0050:临时命令

如果您的意思是从一般用户的角度来看,那么您通常无法查看用户帐户是否存在(这将为垃圾邮件发送者使用它进行目录收集敞开大门),但您可以取消注册帐户(如果您拥有),请参阅 XEP-0077:带内注册了解更多信息信息。

http://xmpp.org/extensions/ 上还有更多适用于各种事物的标准扩展 -有些正在开发中,有些已经完成并稳定。

If you are sending queries from an admin account to do these things, look at XEP-0133: Service Administration, which is based on XEP-0050: Ad-hoc commands.

If you mean more from a general user perspective, well you typically can't see if a user account exists (this would leave the door open for spammers to use it for directory harvesting), but you can unregister an account if you own it, see XEP-0077: In-band Registration for more information.

There are many more standard extensions for all kinds of things at http://xmpp.org/extensions/ - some are under development, some are finalized and stable.

々眼睛长脚气 2024-09-11 04:48:35

如果您使用 ejabberd,命令行实用程序 ejabberdctl 可以解决您的问题。

user@server:~$ sudo /opt/ejabberd-2.1.8/bin/ejabberdctl 
Usage: ejabberdctl [--node nodename] [--auth user host password] command [options]

Available commands in this ejabberd node:
  backup file                                                         Store the database to backup file 
  connected_users                                                     List all established sessions 
  connected_users_number                                              Get the number of established sessions 
  delete_expired_messages                                             Delete expired offline messages from database 
  delete_old_messages days                                            Delete offline messages older than DAYS 
  dump file                                                           Dump the database to text file 
  dump_table file table                                               Dump a table to text file 
  export_piefxis dir                                                  Export data of all users in the server to PIEFXIS 
                                                                      files (XEP-0227) 
  export_piefxis_host dir host                                        Export data of users in a host to PIEFXIS files 
                                                                      (XEP-0227) 
  get_loglevel                                                        Get the current loglevel 
  help [--tags [tag] | com?*]                                         Show help (try: ejabberdctl help help) 
  import_dir file                                                     Import users data from jabberd14 spool dir 
  import_file file                                                    Import user data from jabberd14 spool file 
  import_piefxis file                                                 Import users data from a PIEFXIS file (XEP-0227) 
  incoming_s2s_number                                                 Number of incoming s2s connections on the node 
  install_fallback file                                               Install the database from a fallback file 
  load file                                                           Restore the database from text file 
  mnesia [info]                                                       show information of Mnesia system 
  mnesia_change_nodename oldnodename newnodename oldbackup newbackup  Change the erlang node name in a backup file 
  outgoing_s2s_number                                                 Number of outgoing s2s connections on the node 
  register user host password                                         Register a user 
  registered_users host                                               List all registered users in HOST 
  rename_default_nodeplugin                                           Update PubSub table from old ejabberd trunk SVN to 
                                                                      2.1.0 
  reopen_log                                                          Reopen the log files 
  restart                                                             Restart ejabberd 
  restore file                                                        Restore the database from backup file 
  set_master nodename                                                 Set master node of the clustered Mnesia tables 
  status                                                              Get ejabberd status 
  stop                                                                Stop ejabberd 
  stop_kindly delay announcement                                      Inform users and rooms, wait, and stop the server 
  unregister user host                                                Unregister a user 
  update module                                                       Update the given module, or use the keyword: all 
  update_list                                                         List modified modules that can be updated 
  user_resources user host                                            List user's connected resources 

Examples:
  ejabberdctl restart
  ejabberdctl --node ejabberd@host restart

Commands to start an ejabberd node:
  start  Start an ejabberd node in server mode
  debug  Attach an interactive Erlang shell to a running ejabberd node
  live   Start an ejabberd node in live (interactive) mode

If you use ejabberd, there is command line utility ejabberdctl that will solve your questions.

user@server:~$ sudo /opt/ejabberd-2.1.8/bin/ejabberdctl 
Usage: ejabberdctl [--node nodename] [--auth user host password] command [options]

Available commands in this ejabberd node:
  backup file                                                         Store the database to backup file 
  connected_users                                                     List all established sessions 
  connected_users_number                                              Get the number of established sessions 
  delete_expired_messages                                             Delete expired offline messages from database 
  delete_old_messages days                                            Delete offline messages older than DAYS 
  dump file                                                           Dump the database to text file 
  dump_table file table                                               Dump a table to text file 
  export_piefxis dir                                                  Export data of all users in the server to PIEFXIS 
                                                                      files (XEP-0227) 
  export_piefxis_host dir host                                        Export data of users in a host to PIEFXIS files 
                                                                      (XEP-0227) 
  get_loglevel                                                        Get the current loglevel 
  help [--tags [tag] | com?*]                                         Show help (try: ejabberdctl help help) 
  import_dir file                                                     Import users data from jabberd14 spool dir 
  import_file file                                                    Import user data from jabberd14 spool file 
  import_piefxis file                                                 Import users data from a PIEFXIS file (XEP-0227) 
  incoming_s2s_number                                                 Number of incoming s2s connections on the node 
  install_fallback file                                               Install the database from a fallback file 
  load file                                                           Restore the database from text file 
  mnesia [info]                                                       show information of Mnesia system 
  mnesia_change_nodename oldnodename newnodename oldbackup newbackup  Change the erlang node name in a backup file 
  outgoing_s2s_number                                                 Number of outgoing s2s connections on the node 
  register user host password                                         Register a user 
  registered_users host                                               List all registered users in HOST 
  rename_default_nodeplugin                                           Update PubSub table from old ejabberd trunk SVN to 
                                                                      2.1.0 
  reopen_log                                                          Reopen the log files 
  restart                                                             Restart ejabberd 
  restore file                                                        Restore the database from backup file 
  set_master nodename                                                 Set master node of the clustered Mnesia tables 
  status                                                              Get ejabberd status 
  stop                                                                Stop ejabberd 
  stop_kindly delay announcement                                      Inform users and rooms, wait, and stop the server 
  unregister user host                                                Unregister a user 
  update module                                                       Update the given module, or use the keyword: all 
  update_list                                                         List modified modules that can be updated 
  user_resources user host                                            List user's connected resources 

Examples:
  ejabberdctl restart
  ejabberdctl --node ejabberd@host restart

Commands to start an ejabberd node:
  start  Start an ejabberd node in server mode
  debug  Attach an interactive Erlang shell to a running ejabberd node
  live   Start an ejabberd node in live (interactive) mode
岁月如刀 2024-09-11 04:48:35

我发现“XMPP:权威指南”这本书对于了解该协议很有用及其术语。 XEP 可以作为之后的参考。

I found the book "XMPP: The Definitive Guide" useful to get an overview of the protocol and its terminology. The XEPs are good as references after that.

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