wetty 安装(web+tty)

wetty 安装

wetty=web+tty

一. 安装环境 nodejs和npm

  1. 先安装 nvm , 即是Node Version Manager(Node版本管理器)
    curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
    或者使用 wget
    wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash

  2. 激活nvm:
    source ~/.nvm/nvm.sh

  3. 安装node
    nvm install node

  4. 安装完成后,切换到该版本
    nvm use node

二. 安装 wetty

  1. 开始安装wetty
    git clone https://github.com/krishnasrinivas/wetty
    cd wetty
    npm install

  2. 从 Web 浏览器启动 Wetty 并访问 Linux 终端
    node app.js -p 8080

  3. 为 Wetty 安装 HTTPS 证书
    openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365 -nodes

  4. 通过 HTTPS 来使用 Wetty
    nohup node app.js --sslkey key.pem --sslcert cert.pem -p 8080 &

附录

posted @ 2018-08-23 15:18  bret_chen  阅读(913)  评论(0编辑  收藏  举报