| 23 | ) |
| 24 | |
| 25 | type Proxy struct { |
| 26 | Kite *kite.Kite |
| 27 | |
| 28 | listener net.Listener |
| 29 | TLSConfig *tls.Config |
| 30 | |
| 31 | readyC chan bool // To signal when kite is ready to accept connections |
| 32 | closeC chan bool // To signal when kite is closed with Close() |
| 33 | |
| 34 | // Holds registered kites. Keys are kite IDs. |
| 35 | kites map[string]url.URL |
| 36 | kitesMu sync.Mutex |
| 37 | |
| 38 | // muxer for proxy |
| 39 | mux *http.ServeMux |
| 40 | websocketProxy http.Handler |
| 41 | httpProxy http.Handler |
| 42 | |
| 43 | // Proxy properties used to give urls and bind the listener |
| 44 | Scheme string |
| 45 | PublicHost string // If given it must match the domain in certificate. |
| 46 | PublicPort int // Uses for registering and defining the public port. |
| 47 | } |
| 48 | |
| 49 | func New(conf *config.Config) *Proxy { |
| 50 | k := kite.New(Name, Version) |
nothing calls this directly
no outgoing calls
no test coverage detected