Documentation
ΒΆ
Index ΒΆ
- Constants
- 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)
- 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 ΒΆ
This section is empty.
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 // 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