用户

获取用户列表

URI

GET /admin-api/socks5_proxy/{id}/users

URI 参数

  • detail

    type: integer

    required: no

    description: 获取详细的 DNS 应用信息

  • page

    type: integer

    required: no

    description: 第几页,从 1 开始

  • page_size

    type: integer

    required: no

    description: 每页大小,默认 20

请求示例

Shell

curl http://{admin-site}/admin-api/socks5_proxy/3/users?page=1&page_size=20&detail=1

响应示例

Status: 200 OK
{
    "data": [
        {
            "password": "",
            "gid": 3,
            "username": "openresty",
            "id": 3
        }
    ],
    "status": 0
}

添加用户

URI

POST /admin-api/socks5_proxy/{id}/users

JSON Body 参数

  • username

    type: string

    required: no

    description: 用户名称

  • password

    type: string

    required: no

    description: 密码

  • gid

    type: integer

    required: no

    description: 用户组

请求示例

Shell

curl -X POST http://{admin-site}/admin-api/socks5_proxy/{id}/users -d
'{
    "username": "openresty",
    "password": "{PASSWORD}",
    "gid": 3
}'

响应示例

Status: 200 OK
{
    "status": 0,
    "data": {
        "id": 1
    }
}

修改用户

URI

PUT /admin-api/socks5_proxy/{id}/users/{id}

JSON Body 参数

  • username

    type: string

    required: no

    description: 用户名称

  • password

    type: string

    required: no

    description: 密码

  • gid

    type: integer

    required: no

    description: 用户组

请求示例

Shell

curl -X PUT http://{admin-site}/admin-api/socks5_proxy/{id}/users/{id} -d
'{
    "password": "",
    "gid": 3,
    "username": "openresty2",
    "id": 3
}'

响应示例

Status: 200 OK
{
    "status": 0
}

删除用户

URI

DELETE /admin-api/socks5_proxy/{id}/users/{id}

请求示例

Shell

curl -X DELETE http://{admin-site}/admin-api/socks5_proxy/{id}/users/{id}

响应示例

Status: 200 OK
{
    "status": 0
}