(r *kite.Request)
| 123 | } |
| 124 | |
| 125 | func (p *Proxy) handleRegister(r *kite.Request) (interface{}, error) { |
| 126 | kiteUrl, err := url.Parse(r.Args.One().MustString()) |
| 127 | if err != nil { |
| 128 | return nil, err |
| 129 | } |
| 130 | |
| 131 | p.kites[r.Client.ID] = *kiteUrl |
| 132 | |
| 133 | proxyURL := url.URL{ |
| 134 | Scheme: p.Scheme, |
| 135 | Host: p.PublicHost + ":" + strconv.Itoa(p.PublicPort), |
| 136 | Path: "/proxy/" + r.Client.ID, |
| 137 | } |
| 138 | |
| 139 | s := proxyURL.String() |
| 140 | p.Kite.Log.Info("Registering kite with url: '%s'. Can be reached now with: '%s'", kiteUrl, s) |
| 141 | |
| 142 | return s, nil |
| 143 | } |
| 144 | |
| 145 | func (p *Proxy) backend(req *http.Request) *url.URL { |
| 146 | withoutProxy := strings.TrimPrefix(req.URL.Path, "/proxy") |
nothing calls this directly
no test coverage detected