Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: inconshreveable/ngrok
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: HstarStudio/ngrok
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
  • 1 commit
  • 7 files changed
  • 1 contributor

Commits on Nov 2, 2017

  1. Update for run in windows

    Jay.M.Hu committed Nov 2, 2017
    Copy the full SHA
    c2a5565 View commit details
Showing with 120 additions and 23 deletions.
  1. +2 −0 .gitignore
  2. +3 −0 {docs → }/CHANGELOG.md
  3. +12 −0 README.md
  4. +37 −21 docs/{DEVELOPMENT.md → 开发文档.md}
  5. +2 −2 docs/{SELFHOSTING.md → 自托管.md}
  6. +32 −0 make-release.bat
  7. +32 −0 make.bat
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -8,3 +8,5 @@ src/launchpad.net
src/gopkg.in
src/ngrok/client/assets/
src/ngrok/server/assets/
*.log
*.log.*
3 changes: 3 additions & 0 deletions docs/CHANGELOG.md → CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Changelog

##

## 1.7 - 6/6/2014
- IMPROVEMENT: Print a better help message when run without any arguments
- IMPROVEMENT: Display useful help message and instructions when double-clicked from explorer on Windows
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@

# 如何运行






============================================



[![Build
status](https://travis-ci.org/inconshreveable/ngrok.svg)](https://travis-ci.org/inconshreveable/ngrok)

58 changes: 37 additions & 21 deletions docs/DEVELOPMENT.md → docs/开发文档.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
# Developer's guide to ngrok
# ngrok 开发者指南


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

## Compiling
## 编译

git clone git@github.com:inconshreveable/ngrok.git
cd ngrok && make
bin/ngrok [LOCAL PORT]
```bash
git clone git@github.com:inconshreveable/ngrok.git
cd ngrok && make
bin/ngrok [LOCAL PORT]
```

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

make client
make server

**NB: You must compile with Go 1.1+! You must have Mercurial SCM Installed.**
**注意: 必须使用Go 1.1以上进行编译!必须先安装 Mercurial SCM**

### 编译发行版本
不管是客户端还是服务端都包含有静态资源文件。

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

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


## Developing locally
The strategy I use for developing on ngrok is to do the following:
## 本地开发

可以用以下策略进行本地开发:

添加如下行到 `/etc/hosts`:

Add the following lines to /etc/hosts:
```
127.0.0.1 ngrok.me
127.0.0.1 test.ngrok.me
```
> 如果是Windows环境,则同样添加如上行到 `C:\Windows\System32\drivers\etc\hosts`
127.0.0.1 ngrok.me
127.0.0.1 test.ngrok.me
使用如下参数运行 `ngrokd`:

Run ngrokd with the following options:
```
./bin/ngrokd -domain ngrok.me
```
> Windows下使用如下命令
./bin/ngrokd -domain ngrok.me
```
ngrokd -domain ngrok.me
```

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

server_addr: ngrok.me:4443
tunnels:
test:
proto:
http: 8080
```
server_addr: ngrok.me:4443
tunnels:
test:
proto:
http: 8000
```


Then run ngrok with either of these commands:
4 changes: 2 additions & 2 deletions docs/SELFHOSTING.md → docs/自托管.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# How to run your own ngrokd server
# 如何运行你自己的 `ngrokd` 服务

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

## 1. Get an SSL certificate
ngrok provides secure tunnels via TLS, so you'll need an SSL certificate. Assuming you want to create
32 changes: 32 additions & 0 deletions make-release.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
SET GOPATH=%__CD__%

set BUILDTAGS=release

go fmt ngrok/...

echo "fmt ok"

go get github.com/jteeuwen/go-bindata/go-bindata
echo "bin/go-bindata ok"

"bin\go-bindata.exe" -nomemcopy -pkg=assets -tags=%BUILDTAGS% -debug=false -o=src/ngrok/client/assets/assets_%BUILDTAGS%.go assets/client/...
echo "client-assets ok"

"bin\go-bindata.exe" -nomemcopy -pkg=assets -tags=%BUILDTAGS% -debug=false -o=src/ngrok/server/assets/assets_%BUILDTAGS%.go assets/server/...
echo "server-assets ok"

echo "assets ok"

go get -tags '%BUILDTAGS%' -d -v ngrok/...

echo "deps ok"

go install -tags '%BUILDTAGS%' ngrok/main/ngrok

echo "client ok"

go install -tags '%BUILDTAGS%' ngrok/main/ngrokd

echo "server ok"

cmd
32 changes: 32 additions & 0 deletions make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
SET GOPATH=%__CD__%

set BUILDTAGS=debug

go fmt ngrok/...

echo "fmt ok"

go get github.com/jteeuwen/go-bindata/go-bindata
echo "bin/go-bindata ok"

"bin\go-bindata.exe" -nomemcopy -pkg=assets -tags=%BUILDTAGS% -debug=false -o=src/ngrok/client/assets/assets_%BUILDTAGS%.go assets/client/...
echo "client-assets ok"

"bin\go-bindata.exe" -nomemcopy -pkg=assets -tags=%BUILDTAGS% -debug=false -o=src/ngrok/server/assets/assets_%BUILDTAGS%.go assets/server/...
echo "server-assets ok"

echo "assets ok"

go get -tags '%BUILDTAGS%' -d -v ngrok/...

echo "deps ok"

go install -tags '%BUILDTAGS%' ngrok/main/ngrok

echo "client ok"

go install -tags '%BUILDTAGS%' ngrok/main/ngrokd

echo "server ok"

cmd