Skip to content

WebSocket commands and responses

Carlos Mesa edited this page Aug 13, 2019 · 19 revisions

WebSocket commands and responses

Technical info below! This is only important to you if you are considering creating a new client or if you want to extend WebConsole possibilities. Below is a detailed list containing all current WebConsole commands, along with the data that the server will send in response to these commands. This information applies to WebConsole v1.1.0

Commands

LOGIN (password)

Logs user in into server. This is the first command client should send to server. Login is required in order to run any of the other commands.

Example usage: LOGIN myPassw0rd

Responds with:

  • 200 If password was correct
  • 401 If password was incorrect

EXEC (command)

Execute a command into the Minecraft Server console as if you were typing into the real console.

Example usage: EXEC say Hello from WebConsole!

Responds with:
This message does not generate a response itself, but WebConsole will send you the console output generated for your command with a 010 message.

Responses

All responses are sent into a JSON string. Every response will contain a status and statusDescription parameter to allow the client know the response type. All possibilities are shown below.

010 Console Output

Sends a line printed in Minecraft console.

Extra parameters:

  • message: Contains the console line printed into real console.

Example response:

{status: 10, statusDescription: "Console Output", message: "[Server] Hello from WebConsole!"}

200 Processed

Tells the client that a previously sended command was sucessfully processed.

Extra parameters:

  • respondsTo: Command that originated this response.
  • message: User-readable message containing additional info.

Example response:

{status: 200, statusDescription: "Processed", respondsTo: "LOGIN ********", message: "Logged In"}

400 Unknown Command

A sended command does not exist or was not understood by server.

Extra parameters:

  • respondsTo: Command that originated this response.
  • message: User-readable message containing additional info.

Example response:

{status: 400, statusDescription: "Unknown Command", respondsTo: "ESEC esec command do not exist!", message: "Unknown command"}

401 Login Required

First message that client will receive when connecting to a server. Informs that login is required with a valid password in order to start executing commands.

Extra parameters:

  • message: User-readable message containing additional info.

Example response:

{status: 401, statusDescription: "Login Required", message: "Connection started, waiting login"}
Clone this wiki locally