阅读量:0
安装包官网:GitHub - codeskyblue/gohttpserver: The best HTTP Static File Server, write with golang+vue
1、官网下载或本文章的资源链接下载gohttpserver;
2、将gohttpserver、cacert.pem、cakey.pem三个文件放在linux一个目录下
启动gohttpserver服务:
http服务端口4044:nohup ./gohttpserver --upload -a :4044 -r /root &
https服务端口3034:nohup ./gohttpserver --cert cacert.pem --key cakey.pem --upload -a :3034 -r /root &
3、netstat -npl | grep gohttp查看服务
[root@localhost ~]# netstat -npl | grep gohttp
tcp6 0 0 :::4044 :::* LISTEN 13654/./gohttpserve
tcp6 0 0 :::3034 :::* LISTEN 11038/./gohttpserve
搭建完成,浏览器正常访问ip+端口即可