en cs

Nocheto HTTP API v 0.2 / Example 0.3

This is the example for HTTP API version 0.2 tested in Nocheto 3.2.0. It should work with 2.7.0 too, but not all functions of this example are available with nocheto 2.7.0.

See also v 0.4 HTTP API.

Example v 0.33.2.0

Download: http_0.3.zip (Sign in to download the file).

Installation

Unpack the zip archive and move the http/ directory into ~/.nocheto/ directory.

Usage

Run nocheto with the --future option and then execute the http command.
Open http://localhost:8080/ in your browser.

If you prefer the light design, just remove the www/css/reverse.css file.

HTTP Web Example

Configuration

This is the description of the [http] config section for Nocheto 2.5.0 - 2.7.X and 3.0.0 - 3.2.X.
For newer Nocheto versions please see the v 0.4 configuration.

Add the following section into your configuration file (i.e. ~/.nocheto/config/nocheto.ini).


[http]
port = 8080
address = "127.0.0.1"
whitelist = "treenumber;new;move;flipboard;uu;redo;r;r<;r>;skip;skip<;skip>;goto;cut;delete;branchup;loadresults;lr;hint;analyze;nag;setnag;comment;bcomment;level;seconds;autoplay;setoption;board;b;undo;u;moves;play;p;switchsounds;fen;tag;stop;speach;echo;ipv4;quit"
rootdir = "/home/<your home dir>/.nocheto/http/"
authentication = ""
requestlogfile = ""

Now you can run the http command and open the corresponding URL in your internet browser (for example http://127.0.0.1:8080/).

port2.4.0

port="8080"

Port number where nocheto will accept HTTP connections.

address2.4.0

address="127.0.0.1"

IP address where nocheto will accept HTTP connections.
Use 0.0.0.0 to accept from all available addresses.

whitelist2.4.0

whitelist = "treenumber;new;move;flipboard;uu;redo;r;r<;r<<;r>;goto;cut;delete;branchup;loadresults;lr;hint;analyze;nag;setnag;comment;bcomment;level;seconds;autoplay;setoption;board;b;undo;u;moves;play;p;switchsounds;fen;tag;quit;stop;speach;echo"
    

List of allowed commands accepted by nocheto through the HTTP api.

rootdir2.4.0

rootdir = "<$HOME>/.nocheto/http/"

Root directory for files provided by nocheto through the HTTP API.
Default is the ~/.nocheto/http/ directory.

authentication3.0.0

authentication = ""

HTTP authentication in base64 encoding.
Default value is bm9jaGV0bzpub2NoZXRv (=base64('nocheto:nocheto'))

requestlogfile3.0.0

requestlogfile=""

Path to a file where nocheto will log HTTP requests (if set).