MCPcopy Index your code
hub / github.com/koding/kite / handleRegister

Method handleRegister

reverseproxy/reverseproxy.go:125–143  ·  view source on GitHub ↗
(r *kite.Request)

Source from the content-addressed store, hash-verified

123}
124
125func (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
145func (p *Proxy) backend(req *http.Request) *url.URL {
146 withoutProxy := strings.TrimPrefix(req.URL.Path, "/proxy")

Callers

nothing calls this directly

Calls 4

MustStringMethod · 0.80
OneMethod · 0.80
InfoMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected