Giter Club home page Giter Club logo

my-stream-fe's Introduction

项目名称

MyStream - 自定义 P2P 视频直播系统

环境准备

配置 mongoDB

在 Docker [下载网址] 下进行安装

docker pull mongo:5.0.13

docker run -d --name mongodb -v /home/mongo/db:/data/db -p 27017:27017 mongo:5.0.13

配置本地 SSL

开启本地 HTTPS 需要额外生成本地 SSL 证书,并在项目中进行引用。

使用 mkcert (仅 macOS)
  1. 安装 mkcert

    brew install mkcert
    brew install nss # if you use Firefox
  2. 添加 mkcert 到你本地 CA 中

    mkcert -install
  3. 生成本地证书

    在终端中 cd 到本项目的根目录,然后执行

    mkcert localhost
    mv localhost-key.pem localhost.pem config/cert
  4. [可选] 更改证书引用路径

    如果证书名字有更改的话,在 nuxt.config.jssrc/api/modules/socket-io/index.ts 中更改引用路径

使用 OpenSSL
openssl req -x509 -nodes -new -sha256 -days 1024 -newkey rsa:2048 -keyout RootCA.key -out RootCA.pem -subj "/C=US/CN=Example-Root-CA"
openssl x509 -outform pem -in RootCA.pem -out RootCA.crt

mv RootCA.crt ./config/cert/localhost-cert.crt
mv RootCA.key ./config/cert/localhost-key.key
rm RootCA.pem

把证书设置为本地信任,然后检查下列文件中证书引用路径是否正确。

  • nuxt.config.js
  • src/api/modules/socket-io/index.ts

相关链接: https://web.dev/how-to-use-local-https/

项目启动

部署网址

本地

注意: 非 https 环境下,无法正常使用 WebRTC.

测试环境

https://mystream-dev.jonaspete.com

构建命令

安装依赖

npm i

本地调试 (https)

npm run dev:https

生产环境

构建并启动服务 (http)

npm run build
npm run start

引用

file-icon-vectors: https://github.com/dmhendricks/file-icon-vectors

Robot Avatar Icons: https://dighital.com/icon-pack/icons/flat-icons/robot-avatar-icons/


App built by NuxtJS.

For detailed explanation on how things work, check out Nuxt.js docs.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.