1
- # Developer's guide to ngrok
1
+ # ngrok 开发者指南
2
2
3
3
4
- ## Components
4
+ ## 组件
5
5
The ngrok project is composed of two components, the ngrok client (ngrok) and the ngrok server (ngrokd).
6
6
The ngrok client is the more complicated piece because it has UIs for displaying saved requests and responses.
7
7
8
- ## Compiling
8
+ ## 编译
9
9
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
+ ```
13
15
14
16
There are Makefile targets for compiling just the client or server.
15
17
16
18
make client
17
19
make server
18
20
19
- ** NB: You must compile with Go 1.1+! You must have Mercurial SCM Installed.**
21
+ ** 注意: 必须使用Go 1.1以上进行编译!必须先安装 Mercurial SCM**
22
+
23
+ ### 编译发行版本
24
+ 不管是客户端还是服务端都包含有静态资源文件。
20
25
21
- ### Compiling release versions
22
- Both the client and the server contain static asset files.
23
26
These include TLS/SSL certificates and the html/css/js for the client's web interface.
24
27
The release versions embed all of this data into the binaries themselves, whereas the debug versions read these files from the filesystem.
25
28
@@ -32,25 +35,38 @@ There are Makefile targets for compiling the client and server for releases:
32
35
make release-all
33
36
34
37
35
- ## Developing locally
36
- The strategy I use for developing on ngrok is to do the following:
38
+ ## 本地开发
39
+
40
+ 可以用以下策略进行本地开发:
41
+
42
+ 添加如下行到 ` /etc/hosts ` :
37
43
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 `
39
49
40
- 127.0.0.1 ngrok.me
41
- 127.0.0.1 test.ngrok.me
50
+ 使用如下参数运行 ` ngrokd ` :
42
51
43
- Run ngrokd with the following options:
52
+ ```
53
+ ./bin/ngrokd -domain ngrok.me
54
+ ```
55
+ > Windows下使用如下命令
44
56
45
- ./bin/ngrokd -domain ngrok.me
57
+ ```
58
+ ngrokd -domain ngrok.me
59
+ ```
46
60
47
61
Create an ngrok configuration file, "debug.yml" with the following contents:
48
62
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
+ ```
54
70
55
71
56
72
Then run ngrok with either of these commands:
0 commit comments