其他分享
首页 > 其他分享> > WebRTC 使用笔记

WebRTC 使用笔记

作者:互联网

1. 安装go语言开发环境,下载地址 https://golang.google.cn/dl/

2. 下载RTSPwoWeb,地址 https://github.com/deepch/RTSPtoWeb

3. 解压目录,命令行运行 go env -w GO111MODULE=on 设置环境

4. 修改配置文件,config.json

{
  "server": {
    "debug": false, // 调试模式
    "http_debug": false,
    "http_demo": false,// 是否显示示例,开启后可访问localhost:8083查看
    "http_dir": "web",
    "http_login": "demo",
    "http_password": "demo",
    "http_port": ":8083",
    "https": false,
    "https_auto_tls": false,
    "https_auto_tls_name": "",
    "https_cert": "server.crt",
    "https_key": "server.key",
    "https_port": ":443",
    "ice_servers": [
      "stun:stun.l.google.com:19302"
    ],
    "log_level": "debug",
    "rtsp_port": ":5541",
    "token": {
      "backend": "http://127.0.0.1/test.php"
    },
    "defaults": {
      "audio": false
    }
  },
  "streams": {
    "27aec28e-6181-4753-9acd-0456a75f0289": {
      "channels": {
        "0": {
          "url": "", // rtsp流地址
          "debug": false,
          "audio": false // 是否转音频
        }
      },
      "name": "robot"
    }
  }
}

5. 运行命令 go run ./ ,访问 http://localhost:8083 查看结果

标签:http,笔记,server,go,https,使用,debug,false,WebRTC
来源: https://www.cnblogs.com/Bin-x/p/16074796.html