跳转到主要内容
POST
/
conn
/
kick
curl -X POST "http://localhost:5001/conn/kick" \
  -H "Content-Type: application/json" \
  -d '{
    "uid": "user123",
    "conn_id": 12345,
    "node_id": 1
  }'
{
  "status": "ok"
}

概述

踢出/断开指定用户的特定连接,与移除连接类似,但通常用于主动断开活跃连接。

请求体

uid
string
required
用户 ID
conn_id
integer
required
连接 ID
node_id
integer
节点 ID,指定特定节点上的连接
curl -X POST "http://localhost:5001/conn/kick" \
  -H "Content-Type: application/json" \
  -d '{
    "uid": "user123",
    "conn_id": 12345,
    "node_id": 1
  }'
{
  "status": "ok"
}

响应字段

status
string
required
操作状态,成功时返回 "ok"

状态码

状态码说明
200连接踢出成功
400请求参数错误
404连接不存在
500服务器内部错误

与移除连接的区别

操作接口用途特点
踢出连接/conn/kick主动断开活跃连接会发送断开通知给客户端
移除连接/conn/remove清理连接记录直接清理服务器端连接记录