Documentation ¶
Index ¶
- Constants
- func CheckPublicKeys(trustedPubKeys ...[]byte) (func(ssh.PublicKey) bool, error)
- func WebsocketDial(ctx context.Context, addr string) (net.Conn, error)
- func WebsocketUpgrade(conn io.ReadWriter) error
- type ClientType
- type Command
- type DB
- type ExecMeta
- type Hub
- type HubHeader
- type Logger
- type Master
- func (m *Master) Connect(conn io.ReadWriteCloser) error
- func (m *Master) Exec(in io.Reader, out io.Writer, cmd string, args ...string) error
- func (m *Master) ForwardHTTP(listenTo net.Listener) error
- func (m *Master) ForwardSocks5(listenTo net.Listener) error
- func (m *Master) ServeNFS(remoteDir string, fsSrv net.Listener, cacheLimit int) error
- type MountDirMeta
- type Servant
- type ServantID
- type TunnelHeader
Constants ¶
View Source
const ( UnmarshalMetaFailed ssh.RejectionReason = iota + ssh.ResourceShortage + 1000 FailedStartPTY )
View Source
const DefaultSignTimeout = 10 * time.Second
View Source
const ExecResizeRequest = "resize"
Variables ¶
This section is empty.
Functions ¶
func CheckPublicKeys ¶ added in v0.2.0
func WebsocketUpgrade ¶
func WebsocketUpgrade(conn io.ReadWriter) error
Types ¶
type ClientType ¶
type ClientType int
const ( ClientTypeServant ClientType = iota ClientTypeMaster )
type DB ¶
type DB interface { StoreLocation(id string, netAddr string) error LoadLocation(idPrefix string) (netAddr string, id string, err error) DeleteLocation(id string) error }
DB store the location of which hub node the servant is connected to.
type Hub ¶
type Hub struct { Logger *slog.Logger DB DB GetIP func() (string, error) // contains filtered or unexported fields }
func (*Hub) Handle ¶
func (h *Hub) Handle(conn io.ReadWriteCloser)
func (*Hub) MustStartRelay ¶ added in v0.2.3
func (h *Hub) MustStartRelay() func()
MustStartRelay is similar to Hub.StartRelay.
func (*Hub) StartRelay ¶ added in v0.2.3
type HubHeader ¶
type HubHeader struct { Type ClientType ID ServantID }
type Master ¶
func NewMaster ¶
NewMaster creates a new master instance. If the prvKey is nil, it will try ssh agent to use the private key.
func (*Master) Connect ¶
func (m *Master) Connect(conn io.ReadWriteCloser) error
Connect to hub server.
func (*Master) ForwardHTTP ¶ added in v0.4.0
type MountDirMeta ¶
type Servant ¶
func NewServant ¶
func (*Servant) Serve ¶ added in v0.1.0
func (s *Servant) Serve(conn io.ReadWriteCloser) func()
Click to show internal directories.
Click to hide internal directories.