编译go
1. 从官网去下载 1.4.2的源码包。 不要直接从github下载或用1.5版本的源码.这两个都会有问题.
go1.4.2源码:https://golang.org/dl/go1.4.2.src.tar.gz
2. 执行下面命令即可.
tar -xzf go1.4.2.src.tar.gz
pi@raspberrypi ~/go1.4.2/src $ sudo ./all.bash
# Building C bootstrap tool.
cmd/dist
然后会出现 "# Building packages and commands for linux/arm."
随后会做test,直接出现"ALL TESTS PASSED" 就表示大功告成了.
扫描二维码关注公众号,回复:
4299980 查看本文章
添加环境变量
export GOROOT=$HOME/go export PATH=$PATH:$GOROOT/bin
ngrok源码:https://github.com/inconshreveable/ngrok
git clone https://github.com/inconshreveable/ngrok.git cd ngrok && make
使用方法
- 创建配置文件 ngrok.cfg
server_addr: "tunnel.phpor.me:4443"
trust_host_root_certs: false
- 运行
$ ngrok -config ngrok.cfg -subdomain example 8080
ngrok (Ctrl+C to quit) Tunnel Status online Version 1.7/1.7 Forwarding http://example.tunnel.phpor.me -> 127.0.0.1:8080 Forwarding https://example.tunnel.phpor.me -> 127.0.0.1:8080 Web Interface 127.0.0.1:4040 # Conn 0 Avg Conn Time 0.00ms
参考:
http://docscn.studygolang.com/doc/install
另一个ngrok服务器:http://www.ngrok.cc/