aboutsummaryrefslogtreecommitdiff
path: root/route.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-04-01 17:45:07 +0200
committerDimitri Sokolyuk <demon@dim13.org>2016-04-01 17:45:07 +0200
commitc7736d8e94b98c0a4cb9069195cf0e0cfe147283 (patch)
tree71d3405d7702e2cb8dac4c26137ed94b4ff198a0 /route.go
parente3b305e171e6aae5b12db75674003604d0292c9e (diff)
Readd rpc.List
Diffstat (limited to 'route.go')
-rw-r--r--route.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/route.go b/route.go
index 83998fd..47c1ebd 100644
--- a/route.go
+++ b/route.go
@@ -19,6 +19,10 @@ type route struct {
Certificate *tls.Certificate
}
+func (r route) String() string {
+ return fmt.Sprintf("%v → %v", r.ServerName, r.Upstream)
+}
+
// GetCertificate returns certificate for SNI negotiation
func (r Route) GetCertificate(h *tls.ClientHelloInfo) (*tls.Certificate, error) {
host := h.ServerName
@@ -55,7 +59,7 @@ func (r *Route) Load(fname string) error {
}
func (r Route) ServeHTTP(w http.ResponseWriter, _ *http.Request) {
- for k, v := range r {
- fmt.Fprintln(w, k, "→", v)
+ for _, v := range r {
+ fmt.Fprintln(w, v)
}
}