Browse Source

Merge branch 'master' of github.com:inconshreveable/ngrok

Alan Shreve 10 years ago
parent
commit
1014cf7159
5 changed files with 18 additions and 11 deletions
  1. 5 6
      Makefile
  2. 2 5
      README.md
  3. 3 0
      src/ngrok/client/cli.go
  4. 7 0
      src/ngrok/client/config.go
  5. 1 0
      src/ngrok/client/tls.go

+ 5 - 6
Makefile

@@ -18,17 +18,16 @@ client: deps
 
 
 assets: client-assets server-assets
 assets: client-assets server-assets
 
 
-client-assets:
-	go get github.com/jteeuwen/go-bindata
-	GOOS="" GOARCH="" go install github.com/jteeuwen/go-bindata/go-bindata
+bin/go-bindata:
+	GOOS="" GOARCH="" go get github.com/jteeuwen/go-bindata/go-bindata
+
+client-assets: bin/go-bindata
 	bin/go-bindata -nomemcopy -pkg=assets -tags=$(BUILDTAGS) \
 	bin/go-bindata -nomemcopy -pkg=assets -tags=$(BUILDTAGS) \
 		-debug=$(if $(findstring debug,$(BUILDTAGS)),true,false) \
 		-debug=$(if $(findstring debug,$(BUILDTAGS)),true,false) \
 		-o=src/ngrok/client/assets/assets_$(BUILDTAGS).go \
 		-o=src/ngrok/client/assets/assets_$(BUILDTAGS).go \
 		assets/client/...
 		assets/client/...
 
 
-server-assets:
-	go get github.com/jteeuwen/go-bindata
-	GOOS="" GOARCH="" go install github.com/jteeuwen/go-bindata/go-bindata
+server-assets: bin/go-bindata
 	bin/go-bindata -nomemcopy -pkg=assets -tags=$(BUILDTAGS) \
 	bin/go-bindata -nomemcopy -pkg=assets -tags=$(BUILDTAGS) \
 		-debug=$(if $(findstring debug,$(BUILDTAGS)),true,false) \
 		-debug=$(if $(findstring debug,$(BUILDTAGS)),true,false) \
 		-o=src/ngrok/server/assets/assets_$(BUILDTAGS).go \
 		-o=src/ngrok/server/assets/assets_$(BUILDTAGS).go \

+ 2 - 5
README.md

@@ -3,7 +3,7 @@
 ![](https://ngrok.com/static/img/overview.png)
 ![](https://ngrok.com/static/img/overview.png)
 
 
 ## What is ngrok?
 ## What is ngrok?
-ngrok is a reverse proxy that creates a secure tunnel between from a public endpoint to a locally running web service.
+ngrok is a reverse proxy that creates a secure tunnel from a public endpoint to a locally running web service.
 ngrok captures and analyzes all traffic over the tunnel for later inspection and replay.
 ngrok captures and analyzes all traffic over the tunnel for later inspection and replay.
 
 
 ## What can I do with ngrok?
 ## What can I do with ngrok?
@@ -25,10 +25,7 @@ ngrok captures and analyzes all traffic over the tunnel for later inspection and
 ngrok has _no_ runtime dependencies. Just download a single binary for your platform and run it. Some premium features
 ngrok has _no_ runtime dependencies. Just download a single binary for your platform and run it. Some premium features
 are only available by creating an account on ngrok.com. If you need them, [create an account on ngrok.com](https://ngrok.com/signup).
 are only available by creating an account on ngrok.com. If you need them, [create an account on ngrok.com](https://ngrok.com/signup).
 
 
-- [Linux](https://dl.ngrok.com/linux_386/ngrok.zip)
-- [Mac OSX](https://dl.ngrok.com/darwin_386/ngrok.zip)
-- [Windows](https://dl.ngrok.com/windows_386/ngrok.zip)
-
+#### [Download ngrok for your platform](https://ngrok.com/download)
 
 
 ## Developing on ngrok
 ## Developing on ngrok
 [ngrok developer's guide](docs/DEVELOPMENT.md)
 [ngrok developer's guide](docs/DEVELOPMENT.md)

+ 3 - 0
src/ngrok/client/cli.go

@@ -22,6 +22,7 @@ Examples:
 Advanced usage: ngrok [OPTIONS] <command> [command args] [...]
 Advanced usage: ngrok [OPTIONS] <command> [command args] [...]
 Commands:
 Commands:
 	ngrok start [tunnel] [...]    Start tunnels by name from config file
 	ngrok start [tunnel] [...]    Start tunnels by name from config file
+	ngrok list                    List tunnel names from config file
 	ngrok help                    Print help
 	ngrok help                    Print help
 	ngrok version                 Print ngrok version
 	ngrok version                 Print ngrok version
 
 
@@ -100,6 +101,8 @@ func ParseArgs() (opts *Options, err error) {
 	}
 	}
 
 
 	switch opts.command {
 	switch opts.command {
+	case "list":
+		opts.args = flag.Args()[1:]
 	case "start":
 	case "start":
 		opts.args = flag.Args()[1:]
 		opts.args = flag.Args()[1:]
 	case "version":
 	case "version":

+ 7 - 0
src/ngrok/client/config.go

@@ -160,6 +160,13 @@ func LoadConfiguration(opts *Options) (config *Configuration, err error) {
 			}
 			}
 		}
 		}
 
 
+	// list tunnels
+	case "list":
+		for name, _ := range config.Tunnels {
+			fmt.Println(name)
+		}
+		os.Exit(0)
+
 	// start tunnels
 	// start tunnels
 	case "start":
 	case "start":
 		if len(opts.args) == 0 {
 		if len(opts.args) == 0 {

+ 1 - 0
src/ngrok/client/tls.go

@@ -1,6 +1,7 @@
 package client
 package client
 
 
 import (
 import (
+	_ "crypto/sha512"
 	"crypto/tls"
 	"crypto/tls"
 	"crypto/x509"
 	"crypto/x509"
 	"encoding/pem"
 	"encoding/pem"