ejabberd配置admin api
文章目录
配置 ejabberd_http导出 mod_http_api handler
listen:
-
port: 5281
module: ejabberd_http
request_handlers:
"/api": mod_http_apiapi 权限
无权限配置 who 配置成 all
api_permissions:
"API used from localhost allows all calls":
who:
- all
what:
- "*"
- "!stop"
- "!start只允许localhost访问
api_permissions:
"API used from localhost allows all calls":
- who:
- ip: "127.0.0.1/8"
- what:
- "*"
- "!stop"
- "!start"一些api需要配置 mod_admin_extra 才能使用,比如 send_message
modules:
mod_admin_extra: {}测试api
deploy@atest:~$ curl -s POST http://localhost:5280/api/registered_vhosts | jq
[
"atest.example.com.cn"
]
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论