Browse Source

web ui address displayed properly in terminal

Alan Shreve 12 years ago
parent
commit
0c7bf6ae13
3 changed files with 3 additions and 1 deletions
  1. 1 0
      src/ngrok/client/state.go
  2. 1 0
      src/ngrok/client/ui/interface.go
  3. 1 1
      src/ngrok/client/ui/terminal.go

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

@@ -22,6 +22,7 @@ type State struct {
 func (s State) GetVersion() string          { return "" }
 func (s State) GetPublicUrl() string        { return s.publicUrl }
 func (s State) GetLocalAddr() string        { return s.opts.localaddr }
+func (s State) GetWebPort() int             { return s.opts.webport }
 func (s State) GetStatus() string           { return s.status }
 func (s State) GetProtocol() proto.Protocol { return s.protocol }
 func (s State) IsStopping() bool            { return s.stopping }

+ 1 - 0
src/ngrok/client/ui/interface.go

@@ -11,6 +11,7 @@ type State interface {
 	GetLocalAddr() string
 	GetStatus() string
 	GetProtocol() proto.Protocol
+        GetWebPort() int
 	IsStopping() bool
 	GetConnectionMetrics() (metrics.Meter, metrics.Timer)
 	GetBytesInMetrics() (metrics.Counter, metrics.Histogram)

+ 1 - 1
src/ngrok/client/ui/terminal.go

@@ -106,7 +106,7 @@ func (t *TermView) draw() {
 			printf(0, 3, "%-30s%s", "Version", state.GetVersion())
 			printf(0, 4, "%-30s%s", "Protocol", state.GetProtocol().GetName())
 			printf(0, 5, "%-30s%s -> %s", "Forwarding", state.GetPublicUrl(), state.GetLocalAddr())
-			printf(0, 6, "%-30s%s", "HTTP Dashboard", "http://127.0.0.1:9999")
+			printf(0, 6, "%-30s%s", "Web Interface", "http://127.0.0.1:%d", state.GetWebPort())
 
 			connMeter, connTimer := state.GetConnectionMetrics()
 			printf(0, 7, "%-30s%d", "# Conn", connMeter.Count())