Some checks failed
Docker Build and Push / build-and-push (push) Has been cancelled
38 lines
709 B
Go
38 lines
709 B
Go
package session
|
|
|
|
import (
|
|
"net"
|
|
|
|
"golang.org/x/crypto/ssh"
|
|
)
|
|
|
|
type Forwarder struct {
|
|
Listener net.Listener
|
|
TunnelType TunnelType
|
|
ForwardedPort uint16
|
|
|
|
getSlug func() string
|
|
setSlug func(string)
|
|
}
|
|
|
|
type ForwardingController interface {
|
|
HandleGlobalRequest(ch <-chan *ssh.Request)
|
|
HandleTCPIPForward(req *ssh.Request)
|
|
HandleHTTPForward(req *ssh.Request, port uint16)
|
|
HandleTCPForward(req *ssh.Request, addr string, port uint16)
|
|
AcceptTCPConnections()
|
|
}
|
|
|
|
type ForwarderInfo interface {
|
|
GetTunnelType() TunnelType
|
|
GetForwardedPort() uint16
|
|
}
|
|
|
|
func (f *Forwarder) GetTunnelType() TunnelType {
|
|
return f.TunnelType
|
|
}
|
|
|
|
func (f *Forwarder) GetForwardedPort() uint16 {
|
|
return f.ForwardedPort
|
|
}
|