Version 0.02 was just released. The most major change in terms of
functionality is the addition of variables support. The format for the
protocol file has also somewhat changed.
The format is as follows:
Alternating "directions" - whatever is written at the begining of the
file is sent upon connection establishment. Then, NetChat waits for
what's written in the second state. When that is received, it sends
what's written in the third state, and so on.
Changing states, as well as doing some other tasks, is performed by
putting in special chars in an escape sequence. The escape character is
"$". In order to put "$" verbatim, you need to double it ($$ causes one
$ to be sent). A command starts with the sequence $. (dollar period),
and ends with either . (period) or a newline. Following the period is a
single letter signifying to command to take. At the moment, just two
commands are available:
E - End state
V - Variable
End state - this means that the current state has ended. Data between
the last $.E command and the end of the file is ignored.
Variable - the var is followed by a name of a file. Each line in the var
file is a single instance of the var. When the file is exhusted, it
starts over. Due to the format of the parser, the file name may not
contain a period.
Sample file http.nch:
The file begins with a URL to send:
GET /$.Vurl. HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; M$$IE 6.0; Window$$ 98)
A few points to notice:
1. The content of the URL is taken from a variable. NetChat will look
for a file called "url", and will take the list of URLs to look for from
2. In the user agent string, since we wanted to put in the dollar sign,
we had to double it.
The state ends with a state end command "$.E". The command termination
in this case is by a newline, while it was a period in the case of $.V
above. Choose whatever best suites your asthetic values.
Lingnu Open Systems Consulting