This is a very simple http static server, sometimes we need it for testing.
If you need a HTTP2 web server in production, try nico
nami
Install via$ nami install github.com/txthinking/httpserver
Usage
$ httpserver
from https://github.com/txthinking/httpserver
-------
我的补充说明:
在Linux vps安装go环境。然后,
cd $GOPATH
go get -u -v github.com/txthinking/httpserver/
cd ~
[root@racknerd-7b97d8 ~]# httpserver -h
Usage of httpserver:
-d string
web root dir (default ".")
-l string
listen address (default ":8080")
[root@racknerd-7b97d8 ~]# httpserver -l :7070
listen http on :7070
在本地机器的浏览器里,访问http://vps-public-ip:7070
No comments:
Post a Comment