- use s.lifecycle.GetConnection().Wait() to block until SSH connection closes - Prevent premature session closure in headless mode In headless mode (ssh -N), there's no channel interaction to block on, so the session would immediately return and close. Now blocking on conn.Wait() keeps the session alive until the client disconnects.
35 lines
571 B
Go
35 lines
571 B
Go
package types
|
|
|
|
type Status string
|
|
|
|
const (
|
|
INITIALIZING Status = "INITIALIZING"
|
|
RUNNING Status = "RUNNING"
|
|
SETUP Status = "SETUP"
|
|
)
|
|
|
|
type Mode string
|
|
|
|
const (
|
|
INTERACTIVE Mode = "INTERACTIVE"
|
|
HEADLESS Mode = "HEADLESS"
|
|
)
|
|
|
|
type TunnelType string
|
|
|
|
const (
|
|
UNKNOWN TunnelType = "UNKNOWN"
|
|
HTTP TunnelType = "HTTP"
|
|
TCP TunnelType = "TCP"
|
|
)
|
|
|
|
type SessionKey struct {
|
|
Id string
|
|
Type TunnelType
|
|
}
|
|
|
|
var BadGatewayResponse = []byte("HTTP/1.1 502 Bad Gateway\r\n" +
|
|
"Content-Length: 11\r\n" +
|
|
"Content-Type: text/plain\r\n\r\n" +
|
|
"Bad Gateway")
|