Browse Source

separate cache keys for each protocol

Alan Shreve 12 years ago
parent
commit
77e3f140ca
2 changed files with 4 additions and 2 deletions
  1. 3 1
      src/ngrok/server/registry.go
  2. 1 1
      src/ngrok/version/version.go

+ 3 - 1
src/ngrok/server/registry.go

@@ -95,7 +95,9 @@ func (r *TunnelRegistry) cacheKeys(t *Tunnel) (ip string, id string) {
 	clientIp := t.ctl.conn.RemoteAddr().(*net.TCPAddr).IP.String()
 	clientId := t.regMsg.ClientId
 
-	return fmt.Sprintf("client-ip:%s", clientIp), fmt.Sprintf("client-id:%s", clientId)
+	ipKey := fmt.Sprintf("client-ip-%s:%s", t.regMsg.Protocol, clientIp)
+	idKey := fmt.Sprintf("client-id-%s:%s", t.regMsg.Protocol, clientId)
+	return ipKey, idKey
 }
 
 func (r *TunnelRegistry) GetCachedRegistration(t *Tunnel) (url string) {

+ 1 - 1
src/ngrok/version/version.go

@@ -7,7 +7,7 @@ import (
 const (
 	Proto = "1"
 	Major = "0"
-	Minor = "16"
+	Minor = "17"
 )
 
 func MajorMinor() string {