添加单条四层转发

请求URL

  • {{url}}/api/stream/create

请求方式

  • post

Header

字段名
示例值
必选
类型
说明

x-api-key

{{x-api-key}}

string

x-api-secret

{{x-api-secret}}

string

请求参数示例

{
  "user_package": 7,
  "listen": [
    {
      "protocol": "tcp",
      "port": "88"
    }
  ],
  "balance_way": "ip_hash",
  "proxy_protocol": true,
  "backend_port": 80,
  "backend": [
    {
      "addr": "1.1.1.1",
      "weight": 1,
      "state": "up"
    }
  ],
  "conn_limit": 100,
  "acl": {
    "default_action": "allow",
    "rule": [
      {
        "ip": "1.1.1.1",
        "action": "deny"
      }
    ]
  }
}

请求json字段说明

字段名
必选
类型
说明

user_package

string

已购套餐ID

listen

array

listen.protocol

string

可选为tcp或udp

listen.port

string

端口

balance_way

string

源站负载均衡方式,可选为ip_hash、rr、least_conn、random

proxy_protocol

boolean

回源是否使用proxy protocol协议

backend_port

string

backend

array

backend.addr

string

backend.weight

string

backend.state

string

state可选为up、down、backup

conn_limit

string

连接数限制

acl

object

acl.default_action

string

default_action可选为allow、deny

acl.rule

array

acl.rule.ip

string

acl.rule.action

string

rule中的action可选为allow,deny

成功返回示例

{
    "code": 0,
    "data": null,
    "msg": "四层转发添加成功"
}

Last updated