Alan Shreve 12 years ago
parent
commit
7bf4547911
3 changed files with 20 additions and 20 deletions
  1. 10 10
      src/ngrok/client/config.go
  2. 2 2
      src/ngrok/client/main.go
  3. 8 8
      src/ngrok/conn/conn.go

+ 10 - 10
src/ngrok/client/config.go

@@ -1,27 +1,27 @@
 package client
 
 import (
-"fmt"
+	"fmt"
 	"io/ioutil"
 	"launchpad.net/goyaml"
+	"net"
+	"net/url"
 	"ngrok/log"
 	"os"
 	"os/user"
 	"path"
-	"strings"
-	"net/url"
-	"net"
 	"strconv"
+	"strings"
 )
 
 type Configuration struct {
-	HttpProxy          string `yaml:"http_proxy"`
-	ServerAddr         string `yaml:"server_addr"`
-	InspectAddr        string `yaml:"inspect_addr"`
-	TrustHostRootCerts bool   `yaml:"trust_host_root_certs"`
-	AuthToken          string `yaml:"auth_token"`
+	HttpProxy          string                         `yaml:"http_proxy"`
+	ServerAddr         string                         `yaml:"server_addr"`
+	InspectAddr        string                         `yaml:"inspect_addr"`
+	TrustHostRootCerts bool                           `yaml:"trust_host_root_certs"`
+	AuthToken          string                         `yaml:"auth_token"`
 	Tunnels            map[string]TunnelConfiguration `yaml:"tunnels"`
-	LogTo			string
+	LogTo              string
 }
 
 type TunnelConfiguration struct {

+ 2 - 2
src/ngrok/client/main.go

@@ -1,11 +1,11 @@
 package client
 
 import (
-"fmt"
-	"os"
+	"fmt"
 	"math/rand"
 	"ngrok/log"
 	"ngrok/util"
+	"os"
 )
 
 func Main() {

+ 8 - 8
src/ngrok/conn/conn.go

@@ -10,8 +10,8 @@ import (
 	"math/rand"
 	"net"
 	"net/http"
-	"ngrok/log"
 	"net/url"
+	"ngrok/log"
 )
 
 type Conn interface {
@@ -104,13 +104,13 @@ func DialHttpProxy(proxyUrl, addr, typ string, tlsCfg *tls.Config) (conn *logged
 
 	var proxyTlsConfig *tls.Config
 	switch parsedUrl.Scheme {
-		case "http":
-			proxyTlsConfig = nil
-		case "https":
-			proxyTlsConfig = new(tls.Config)
-		default:
-			err = fmt.Errorf("Proxy URL scheme must be http or https, got: %s", parsedUrl.Scheme)
-			return
+	case "http":
+		proxyTlsConfig = nil
+	case "https":
+		proxyTlsConfig = new(tls.Config)
+	default:
+		err = fmt.Errorf("Proxy URL scheme must be http or https, got: %s", parsedUrl.Scheme)
+		return
 	}
 
 	// dial the proxy