MCPcopy Create free account
hub / github.com/koding/kite / newTunnel

Method newTunnel

tunnelproxy/proxy.go:286–304  ·  view source on GitHub ↗
(local sockjs.Session)

Source from the content-addressed store, hash-verified

284}
285
286func (k *PrivateKite) newTunnel(local sockjs.Session) *Tunnel {
287 t := &Tunnel{
288 id: atomic.AddUint64(&k.seq, 1),
289 localConn: local,
290 startChan: make(chan bool),
291 closeChan: make(chan bool),
292 }
293
294 // Add to map.
295 k.tunnels[t.id] = t
296
297 // Delete from map on close.
298 go func() {
299 <-t.CloseNotify()
300 delete(k.tunnels, t.id)
301 }()
302
303 return t
304}

Callers 1

handleProxyMethod · 0.80

Calls 1

CloseNotifyMethod · 0.95

Tested by

no test coverage detected