Skip to content
This repository has been archived by the owner on Oct 13, 2020. It is now read-only.

Setup and installation

Waterflames edited this page Feb 9, 2017 · 2 revisions

Installation

  1. Put the plugin in the plugin folder.
  2. Start/reload the server to allow the configuration file to be generated.
  3. Stop the server.
  4. Edit the configuration file.

If you wish to perform websend commands when specific Bukkit events occur, install WSEvents.

Configuration

When Websend runs for the first time, it generates its configuration files. These can be found in the 'Websend' directory in the plugins folder. The trusted.txt file can be used to allow only certain hosts to connect to Websend. By default this file is set to "trust_all", which means all hosts all allowed to connect. To change this, remove the "trust_all" line and add the IP-addresses of the hosts that are allowed to connect, each on a new line. The config.txt file contains all the options for Websend setup and debug. The following options can be set in this file:

Option Comment
URL=phpURL URL to send the POST data to when typing a command ingame.
PASS=password Password to be used in connections.
WEBLISTENER_ACTIVE=false/true Set to true to enable PHP -> bukkit connections. Disabled by default.
ALTPORT=portnumber Enter a portnumber here to use a different TCP port than 4445 for hosting the PHP -> Bukkit server.
Does not affect PHP -> Bukkit connections.
HASH_ALGORITHM=algorithmname If set, the specified hashing algorithm is used to hash the password instead of SHA-512.
DEBUG_WEBSEND=false/true When set to true Websend will output additional output used for debugging. Disabled by default.
GZIP_REQUESTS=false/true When set to true Websend will gzip the JSON data in a Bukkit -> PHP connection.
The data is then available in the $_FILES array instead of the regular $_POST. To use the data, read the "jsonData" file and use the gzdecode function to decompress the bytes into a json string. Then load the json using json_decode function.
If the data does not show up serverside, check the upload_max_filesize, post_max_size and file_uploads variables in php.ini. Disabled by default.
SERVER_BIND_IP=123.456.789.123 Use this option to bind the Websend server to a specific ip address.
WRAP_COMMAND_EXECUTOR=true/false If true, Websend will use additional methods to capture plugin output.
Plugins that use CraftBukkit to access internal craftbukkit methods and data may behave unexpectedly when this is turned on.

Note that a server reload is required to apply the changes to the configuration files.

Usage

Use the command "/ws argument0 argument1" or "/websend argument0 argument1" to start a request from Bukkit to PHP.
See this page for communication from PHP to Bukkit.

Clone this wiki locally