Browse Source

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

Alan Shreve 12 years ago
parent
commit
c6d4295632

+ 4 - 1
Makefile

@@ -10,6 +10,9 @@ deps:
 server: deps
 	go install -tags '$(BUILDTAGS)' main/ngrokd
 
+fmt:
+	go fmt ngrok/...
+
 client: deps
 	go install -tags '$(BUILDTAGS)' main/ngrok
 
@@ -31,7 +34,7 @@ bindata:
 	./bin/go-bindata -b release -i assets/jquery-1.9.1.min.js -o src/ngrok/client/views/web/static/jquery-1.9.1.js.go -m -p static -f JqueryJs
 	./bin/go-bindata -b release -i assets/vkbeautify.js -o src/ngrok/client/views/web/static/vkbeautify.js.go -m -p static -f VkBeautifyJs
 
-all: client server
+all: fmt client server
 
 clean:
 	go clean ngrok/...

+ 1 - 1
src/ngrok/client/views/term/view.go

@@ -1,4 +1,4 @@
-/* 
+/*
    interactive terminal interface for local clients
 */
 package term

+ 1 - 1
src/ngrok/client/views/web/static/debug.go

@@ -11,7 +11,7 @@ import (
 var assetDir string
 
 func init() {
-	// find the directory with the assets. 
+	// find the directory with the assets.
 	// this doesn't work if you:
 	// 1. move the binary
 	// 2. put ngrok in your PATH

+ 2 - 2
src/ngrok/proto/http.go

@@ -70,7 +70,7 @@ func (h *Http) readRequests(tee *conn.Tee, lastTxn chan *HttpTxn) {
 		}
 
 		// make sure we read the body of the request so that
-		// we don't block the writer 
+		// we don't block the writer
 		_, err = httputil.DumpRequest(req, true)
 
 		h.reqMeter.Mark(1)
@@ -100,7 +100,7 @@ func (h *Http) readResponses(tee *conn.Tee, lastTxn chan *HttpTxn) {
 			break
 		}
 		// make sure we read the body of the response so that
-		// we don't block the reader 
+		// we don't block the reader
 		_, _ = httputil.DumpResponse(resp, true)
 
 		txn.Resp = &HttpResponse{Response: resp}

+ 3 - 3
src/ngrok/server/main.go

@@ -116,9 +116,9 @@ func Main() {
 
 	tunnels = NewTunnelManager(opts.domain)
 
-	go proxyListener(&net.TCPAddr{net.ParseIP("0.0.0.0"), opts.proxyPort}, opts.domain)
-	go controlListener(&net.TCPAddr{net.ParseIP("0.0.0.0"), opts.tunnelPort}, opts.domain)
-	go httpListener(&net.TCPAddr{net.ParseIP("0.0.0.0"), opts.publicPort})
+	go proxyListener(&net.TCPAddr{IP: net.ParseIP("0.0.0.0"), Port: opts.proxyPort}, opts.domain)
+	go controlListener(&net.TCPAddr{IP: net.ParseIP("0.0.0.0"), Port: opts.tunnelPort}, opts.domain)
+	go httpListener(&net.TCPAddr{IP: net.ParseIP("0.0.0.0"), Port: opts.publicPort})
 
 	// wait forever
 	done := make(chan int)

+ 1 - 1
src/ngrok/server/tunnel.go

@@ -49,7 +49,7 @@ func newTunnel(m *msg.RegMsg, ctl *Control) (t *Tunnel) {
 	switch t.regMsg.Protocol {
 	case "tcp":
 		var err error
-		t.listener, err = net.ListenTCP("tcp", &net.TCPAddr{net.ParseIP("0.0.0.0"), 0})
+		t.listener, err = net.ListenTCP("tcp", &net.TCPAddr{IP: net.ParseIP("0.0.0.0"), Port: 0})
 
 		if err != nil {
 			panic(err)