Documentation ¶
Index ¶
- Constants
- Variables
- func GetAuthTokenURL(httpURL string) (*url.URL, *http.Header, error)
- func GetURLQuery(rawURL string) (url.Values, error)
- func GetWebsocketURL(httpURL string) (*url.URL, *http.Header, error)
- func NewEscapeProxy(r io.Reader, escapeKeys []byte) io.Reader
- func ParseURL(input string) (string, error)
- func ToBytes(keys string) ([]byte, error)
- type Client
- type EscapeError
Constants ¶
const ( OutputV1 = '0' PongV1 = '1' SetWindowTitleV1 = '2' SetPreferencesV1 = '3' SetReconnectV1 = '4' InputV1 = '0' PingV1 = '1' ResizeTerminalV1 = '2' )
message types for gotty
const ( // Unknown message type, maybe set by a bug UnknownOutput = '0' // Normal output to the terminal Output = '1' // Pong to the browser Pong = '2' // Set window title of the terminal SetWindowTitle = '3' // Set terminal preference SetPreferences = '4' // Make terminal to reconnect SetReconnect = '5' // Unknown message type, maybe sent by a bug UnknownInput = '0' // User input typically from a keyboard Input = '1' // Ping to the server Ping = '2' // Notify that the browser size has been changed ResizeTerminal = '3' )
message types for gotty v2.0
Variables ¶
var ASCII = []string{
"ctrl-@",
"ctrl-a",
"ctrl-b",
"ctrl-c",
"ctrl-d",
"ctrl-e",
"ctrl-f",
"ctrl-g",
"ctrl-h",
"ctrl-i",
"ctrl-j",
"ctrl-k",
"ctrl-l",
"ctrl-m",
"ctrl-n",
"ctrl-o",
"ctrl-p",
"ctrl-q",
"ctrl-r",
"ctrl-s",
"ctrl-t",
"ctrl-u",
"ctrl-v",
"ctrl-w",
"ctrl-x",
"ctrl-y",
"ctrl-z",
"ctrl-[",
"ctrl-\\",
"ctrl-]",
"ctrl-^",
"ctrl-_",
}
ASCII list the possible supported ASCII key sequence
Functions ¶
func GetAuthTokenURL ¶
GetAuthTokenURL transforms a GoTTY http URL to its AuthToken file URL
func GetURLQuery ¶ added in v1.1.0
GetURLQuery returns url.query
func GetWebsocketURL ¶
GetWebsocketURL transforms a GoTTY http URL to its WebSocket URL
func NewEscapeProxy ¶ added in v1.7.0
NewEscapeProxy returns a new TTY proxy reader which wraps the given reader and detects when the specified escape keys are read, in which case the Read method will return an error of type EscapeError.
Types ¶
type Client ¶
type Client struct { Dialer *websocket.Dialer Conn *websocket.Conn URL string WriteMutex *sync.Mutex Output io.Writer SkipTLSVerify bool UseProxyFromEnv bool Connected bool EscapeKeys []byte V2 bool WSOrigin string User string Password string // contains filtered or unexported fields }
func (*Client) ExitLoop ¶ added in v1.3.0
func (c *Client) ExitLoop()
ExitLoop will kill all goroutines launched by c.Loop() ExitLoop() -> wait Loop() -> Close()
func (*Client) GetAuthToken ¶
GetAuthToken retrieves an Auth Token from dynamic auth_token.js file
type EscapeError ¶ added in v1.7.0
type EscapeError struct{}
EscapeError is special error which returned by a TTY proxy reader's Read() method in case its detach escape sequence is read.
func (EscapeError) Error ¶ added in v1.7.0
func (EscapeError) Error() string