Skip to content

Commit c2a5565

Browse files
author
Jay.M.Hu
committed
Update for run in windows
1 parent a8e7fa4 commit c2a5565

7 files changed

+120
-23
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ src/launchpad.net
88
src/gopkg.in
99
src/ngrok/client/assets/
1010
src/ngrok/server/assets/
11+
*.log
12+
*.log.*

docs/CHANGELOG.md CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# Changelog
2+
3+
##
4+
25
## 1.7 - 6/6/2014
36
- IMPROVEMENT: Print a better help message when run without any arguments
47
- IMPROVEMENT: Display useful help message and instructions when double-clicked from explorer on Windows

README.md

+12
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
2+
# 如何运行
3+
4+
5+
6+
7+
8+
9+
============================================
10+
11+
12+
113
[![Build
214
status](https://travis-ci.org/inconshreveable/ngrok.svg)](https://travis-ci.org/inconshreveable/ngrok)
315

docs/DEVELOPMENT.md docs/开发文档.md

+37-21
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,28 @@
1-
# Developer's guide to ngrok
1+
# ngrok 开发者指南
22

33

4-
## Components
4+
## 组件
55
The ngrok project is composed of two components, the ngrok client (ngrok) and the ngrok server (ngrokd).
66
The ngrok client is the more complicated piece because it has UIs for displaying saved requests and responses.
77

8-
## Compiling
8+
## 编译
99

10-
git clone [email protected]:inconshreveable/ngrok.git
11-
cd ngrok && make
12-
bin/ngrok [LOCAL PORT]
10+
```bash
11+
git clone [email protected]:inconshreveable/ngrok.git
12+
cd ngrok && make
13+
bin/ngrok [LOCAL PORT]
14+
```
1315

1416
There are Makefile targets for compiling just the client or server.
1517

1618
make client
1719
make server
1820

19-
**NB: You must compile with Go 1.1+! You must have Mercurial SCM Installed.**
21+
**注意: 必须使用Go 1.1以上进行编译!必须先安装 Mercurial SCM**
22+
23+
### 编译发行版本
24+
不管是客户端还是服务端都包含有静态资源文件。
2025

21-
### Compiling release versions
22-
Both the client and the server contain static asset files.
2326
These include TLS/SSL certificates and the html/css/js for the client's web interface.
2427
The release versions embed all of this data into the binaries themselves, whereas the debug versions read these files from the filesystem.
2528

@@ -32,25 +35,38 @@ There are Makefile targets for compiling the client and server for releases:
3235
make release-all
3336

3437

35-
## Developing locally
36-
The strategy I use for developing on ngrok is to do the following:
38+
## 本地开发
39+
40+
可以用以下策略进行本地开发:
41+
42+
添加如下行到 `/etc/hosts`:
3743

38-
Add the following lines to /etc/hosts:
44+
```
45+
127.0.0.1 ngrok.me
46+
127.0.0.1 test.ngrok.me
47+
```
48+
> 如果是Windows环境,则同样添加如上行到 `C:\Windows\System32\drivers\etc\hosts`
3949
40-
127.0.0.1 ngrok.me
41-
127.0.0.1 test.ngrok.me
50+
使用如下参数运行 `ngrokd`:
4251

43-
Run ngrokd with the following options:
52+
```
53+
./bin/ngrokd -domain ngrok.me
54+
```
55+
> Windows下使用如下命令
4456
45-
./bin/ngrokd -domain ngrok.me
57+
```
58+
ngrokd -domain ngrok.me
59+
```
4660

4761
Create an ngrok configuration file, "debug.yml" with the following contents:
4862

49-
server_addr: ngrok.me:4443
50-
tunnels:
51-
test:
52-
proto:
53-
http: 8080
63+
```
64+
server_addr: ngrok.me:4443
65+
tunnels:
66+
test:
67+
proto:
68+
http: 8000
69+
```
5470

5571

5672
Then run ngrok with either of these commands:

docs/SELFHOSTING.md docs/自托管.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# How to run your own ngrokd server
1+
# 如何运行你自己的 `ngrokd` 服务
22

3-
Running your own ngrok server is really easy! The instructions below will guide you along your way!
3+
运行自己的ngrok服务器真的很容易! 以下说明将引导您一路完成!
44

55
## 1. Get an SSL certificate
66
ngrok provides secure tunnels via TLS, so you'll need an SSL certificate. Assuming you want to create

make-release.bat

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
SET GOPATH=%__CD__%
2+
3+
set BUILDTAGS=release
4+
5+
go fmt ngrok/...
6+
7+
echo "fmt ok"
8+
9+
go get github.com/jteeuwen/go-bindata/go-bindata
10+
echo "bin/go-bindata ok"
11+
12+
"bin\go-bindata.exe" -nomemcopy -pkg=assets -tags=%BUILDTAGS% -debug=false -o=src/ngrok/client/assets/assets_%BUILDTAGS%.go assets/client/...
13+
echo "client-assets ok"
14+
15+
"bin\go-bindata.exe" -nomemcopy -pkg=assets -tags=%BUILDTAGS% -debug=false -o=src/ngrok/server/assets/assets_%BUILDTAGS%.go assets/server/...
16+
echo "server-assets ok"
17+
18+
echo "assets ok"
19+
20+
go get -tags '%BUILDTAGS%' -d -v ngrok/...
21+
22+
echo "deps ok"
23+
24+
go install -tags '%BUILDTAGS%' ngrok/main/ngrok
25+
26+
echo "client ok"
27+
28+
go install -tags '%BUILDTAGS%' ngrok/main/ngrokd
29+
30+
echo "server ok"
31+
32+
cmd

make.bat

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
SET GOPATH=%__CD__%
2+
3+
set BUILDTAGS=debug
4+
5+
go fmt ngrok/...
6+
7+
echo "fmt ok"
8+
9+
go get github.com/jteeuwen/go-bindata/go-bindata
10+
echo "bin/go-bindata ok"
11+
12+
"bin\go-bindata.exe" -nomemcopy -pkg=assets -tags=%BUILDTAGS% -debug=false -o=src/ngrok/client/assets/assets_%BUILDTAGS%.go assets/client/...
13+
echo "client-assets ok"
14+
15+
"bin\go-bindata.exe" -nomemcopy -pkg=assets -tags=%BUILDTAGS% -debug=false -o=src/ngrok/server/assets/assets_%BUILDTAGS%.go assets/server/...
16+
echo "server-assets ok"
17+
18+
echo "assets ok"
19+
20+
go get -tags '%BUILDTAGS%' -d -v ngrok/...
21+
22+
echo "deps ok"
23+
24+
go install -tags '%BUILDTAGS%' ngrok/main/ngrok
25+
26+
echo "client ok"
27+
28+
go install -tags '%BUILDTAGS%' ngrok/main/ngrokd
29+
30+
echo "server ok"
31+
32+
cmd

0 commit comments

Comments
 (0)