http配置

# main启动参数详解

  1. 构建 BootstrapConfig.HttpConfig 配置文件

         BootstrapConfig
              .HttpConfig
              .builder()
              .enable(true)
              .accessLog(true)
              .admin(BootstrapConfig.HttpAdmin.builder().enable(true).username("smqtt").password("smqtt").build())
              .build()
    
    1
    2
    3
    4
    5
    6
    7

    Bootstrap.HttpConfig参数:

    参数 说明 必传 默认值
    enable 启动http false
    accessLog http日志 false
    admin http后台管理配置
    ssl ssl配置 参考ssl配置参数

    BootstrapConfig.HttpAdmin参数:

    参数 说明 必传 默认值
    enable 启动后台管理 false
    username 登陆用户名 smqtt
    password 登陆密码 smqtt
  2. 启动Bootstrap时候设置 BootstrapConfig.HttpConfig

    Bootstrap bootstrap = Bootstrap.builder()
                 .rootLevel(Level.DEBUG)
                 .httpConfig(BootstrapConfig.HttpConfig)
                 .build()
                 .startAwait();
    
    1
    2
    3
    4
    5

# 配置文件启动(docker,jar,springboot)

```
    smqtt:
      logLevel: DEBUG # 系统日志
      http: # http相关配置 端口固定60000
        enable: true # 开关
        accessLog: true # http访问日志
        ssl: # ssl配置
          enable: false
        admin: # 后台管理配置
          enable: true  # 开关
          username: smqtt # 访问用户名
          password: smqtt # 访问密码
```
Last Updated: 12/5/2021, 8:33:06 AM