mirror of
https://github.com/sorenisanerd/gotty.git
synced 2024-11-22 12:24:25 +00:00
0d6766f621
Input chunks from the client exceeding the buffer size would get truncated. Now we communicate the size of the buffer to the webtty and it will split the input into buffer sized chunks. Fixes #1.
34 lines
781 B
Go
34 lines
781 B
Go
package webtty
|
|
|
|
// Protocols defines the name of this protocol,
|
|
// which is supposed to be used to the subprotocol of Websockt streams.
|
|
var Protocols = []string{"webtty"}
|
|
|
|
const (
|
|
// 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'
|
|
)
|
|
|
|
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'
|
|
// Set the input buffer size
|
|
SetBufferSize = '6'
|
|
)
|