Skip to content

Websocket Command Line Tool

Rye Terrell edited this page May 19, 2014 · 1 revision

v 0.3

Server Start

Running on the host

Running on the remote (zproxy)

Message Format

Action: EXEC

If there is no running terminal or command on the connection, starts the Argv command. Otherwise, sends data to stdin.

{
	"Action":	"EXEC",
	"Argv":		["bash", "-c", "ls -al"]
}

-- stdin --

{
	"Action":	"EXEC",
	"Argv":		["your command here"]
}
  • Argv: Command line args. Must specify the file to execute when running a single command. Otherwise, pass stdin to the first element of the 'Argv' param.

Action: FORK

Opens a new PTY terminal on the host.

{
	"Action":	"FORK",
	"Argv":		["/bin/sh","sh"],
	"TermName":	"xterm",
	"TermCwd":	"/home/zenoss",
	"TermCols":	80,
	"TermRows":	24,
	"TermUid":	"zenoss",
	"TermGid":	"zenoss",
	"TermEnv":	{}
	
}
  • Argv: Command to start the shell terminal (default: 'sh')
  • TermName: Name of the terminal (default: SYSTEM DEFINED)
  • TermCwd: The current working directory of the terminal (default: '.')
  • TermCols: Width of the terminal (default: 80)
  • TermRows: Height of the terminal (default: 24)
  • TermUid: Terminal User Id (default: SYSTEM DEFINED)
  • TermGid: Terminal Group Id (default: SYSTEM DEFINED)
  • TermEnv: Environment variables (default: SYSTEM DEFINED)

Action: SIGNAL

Sends a signal to a running process. Typically, this would be SIGINT(0x2), SIGKILL(0x9), or SIGHUP(0x1).

{
	"Action":	"SIGNAL",
	"Signal":	2
}
  • Signal: Signal to send to the running process or terminal.

Action: RESIZE

Resizes the current running terminal.

{
	"Action":	"RESIZE",
	"TermCols":	80,
	"TermRows":	24
}
  • TermCols: Width of the terminal
  • TermRows: Height of the terminal