允许在 Ejabberd 服务器上快速从不同设备进行多个用户注册

要允许在 Ejabberd 服务器上进行多个用户注册,我们需要在 Ejabberd 最新版本中配置文件 ejabberd.yml。配置 ejabberd.yml 就像:在 access_rules:中添加

register:
    - allow
  register_from:
    - allow
  registration_timeout:
    - infinity

  mod_register:
    access_from:
      register_from
    access: 
      register

并在 modules:添加

 mod_register:
    access_from: register_from
    access: register

ejabberd.yml 文件中添加这些规则后保存并运行 Ejabberd 服务器并且为了检查这些规则的目的是否真的添加或不是这样你可以在 Ejabberd 服务器控制台上检查它,原始文件中的 access_rules 将如下所示:

[{access, announce, [{allow, [{acl, admin}]}]},
 {access, c2s,
  [{deny, [{acl, blocked}]}, {allow, [all]}]},
 {access, c2s_shaper,
  [{none, [{acl, admin}]}, {normal, [all]}]},
 {access, configure, [{allow, [{acl, admin}]}]},
 {access, local, [{allow, [{acl, local}]}]},
 {access, max_user_offline_messages,
  [{5000, [{acl, admin}]}, {10000, [all]}]},
 {access, max_user_sessions, [{infinity, [all]}]},
 {access, mod_register,
  [{access_from, [{acl, register_from}]},
   {access, [{acl, register}]}]},
 {access, muc_create, [{allow, [{acl, local}]}]},
 {access, pubsub_createnode, [{allow, [{acl, local}]}]},
 {access, register, [{allow, [all]}]},
 {access, register_from, [{allow, [all]}]},
 {access, registration_timeout, [{infinity, [all]}]},
 {access, s2s_shaper, [{fast, [all]}]},
 {access, trusted_network, [{allow, [all]}]}].

和模块看起来像:

mod_register:[{access_from, register_from},
 {access, register},
 {welcome_message,
  [{subject,
    <<87, 101, 108, 99, 111, 109, 101,
      33>>},
   {body,
    <<72, 105, 46, 10, 87, 101, 108, 99,
      111, 109, 101, 32, 116, 111, 32,
      116, 104, 105, 115, 32, 88, 77,
      80, 80, 32, 115, 101, 114, 118,
      101, 114, 46>>}]},
 {ip_access, trusted_network},
 {access, register}]

现在你的服务器已准备好如此快速地注册来自不同设备的多个用户。谢谢。