Skip to content

使用http-server启动HTTPS代理 #35

@wujunchuan

Description

@wujunchuan

缘由

EOSX - 区块浏览器可以支持自定义节点, 但是有的节点只支持HTTP协议的。浏览器会阻断混合协议的请求(HTTPS+HTTP)

image

这个时候需要起一个本地的服务器做反向代理, 并且开启HTTPS

步骤

  1. 安装mkcert

    brew install mkcert

  2. 生成pem证书

    • 使用mkcert

      mkcert 0.0.0.0 localhost 127.0.0.1 ::1
    • 改名

      mv 0.0.0.0+3-key.pem key.pem
      
      mv 0.0.0.0+3.pem cert.pem
  3. 启动服务

    npx http-server -o -c-1 -p 10240 -P "[http://121.89.208.188:8888](http://121.89.208.188:8888/)" \ 
    -R "/" -S -C cert.pem -o

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions