Contents
Wsplug, version 3.4

Information on new releases,
http://ourworld.compuserve.com/homepages/UrienP/wsplug.htm

Copyright

How to register

Overview

Detailed

Options

Configuration Panel

Server Start Up - Web Server

Setting Content-Type with HTTP/1.0

Web Server Speed Enhancement.

Client Start Up

URL - Page Fetcher

- Url Browser

- The tag.map file, page fetcher configuration.

- Use of the "2mypc" facility

- Speed Enhancement.

Save Options

Ping

Services

Statistics

Command

Command facility

Other information

Common Gateway Interface

Command line


Overview

Wsplug is a demonstration program, which runs over windows sockets (winsock.dll), and implements a general purpose server/client model. Some usefull functions are provided.

WEB SERVER. The GET command (HTTP/1.0) is recognized by the server (using port 80). As an http server Wsplug has been successfully tested with a netscape client, 25 channels are available.
Wsplug includes a CGI facility, which can be used to launch a 16 bit program thru an URL and then to send data back to the client.
 An other Wsplug usefull feature, is the recording of answers to html forms (HTTP/1.0) as an html page (typically named mailbox.htm).

CHAT mode. You can communicate from pc to pc, thru the Internet network, by using one Wsplug as a "standard" server and the other as a "standard" client, (on port 1234 for example).

PROXY. Wsplug offers a proxy facility which records data exchange between a client and a server  (e.g smtp[port 25], telnet [port 23], ftp [port 21], popup3 [port 110] ...). This can be used for tracing or debugging purposes.

PING. A ping function is included

HTTP Client. Wsplug allows you to save HTML documents and included images as files, and then to display them again with your favourite web browser.
 Futhermore Wsplug is able to query each html link found in an html page, this is called an N_Order URL.

Wsplug as a Server.

When used as a server , Wsplug is waiting for connections on the Server Port. By default Wsplug is configured as an http server.

Received characters are echoed according to the Echo_Received_Data flag. If Mode_Text is set on, data is displayed as text, otherwise the hexadecimal format is used (x00 to xFF).

Incoming commands are processed if the Text_ Mode and Execute_Received_Commands options are set on. In this case the only recognized command is "GET filename" (defined by  HTTP/1.0). The filename file must be located in the directory specified by Server_Dir, when'ever it doesn't exist the file stder.htm is sent.

 When Send_And_Close is selected, Wsplug closes the connection after the completion of a GET command.

The Show_Received_Commands option displays an incoming command line, before its interpretation.

The Duplex_Mode flag is used to prevent the processing of any incoming data, while executing a  command. This flag should be set on for this version of Wsplug.

Each character written to the Wsplug windows, can be recorded in a log file, according to the LogFile flag.

If the Echo_Keyboard_to_Client flag is set on, each pressed key is echoed to the server client (a usefull function to communicate thru the network).If you type $ followed by two hexadecimal digits (for example $00,$01,$0A,$48,$FF), data is sent in hexadecimal format.

Wsplug as a Proxy Server.

When this facility is activated, Wsplug establishes a connection between the Wsplug client (connected to ServerPort) and a port (ProxyPort), located at the address ProxyHost. In this case Wsplug acts as an active relay between the client an the ProxyHost.

Data sent and received can be showed on the Wsplug window, according to the Show_Received_data and Text_Mode flags. A log file can be produced if LogFile option is set on.

All other functions (excepted Echo_Keyboard_to_Client), are invalidated in this case (i.e no command processing is available).

Wsplug as a Local Client.

A local client performs a connection to a port of a remote host, which acts as a server.

Received characters are echoed  according to the Echo_Received_Data flag. If Mode_Text is set on, data is displayed as text, otherwise the hexadecimal format is used (x00 to xFF).

If the Echo_Keyboard_to_Client flag is set on, each character entered on the keyboard is echoed to the server client (a usefull function to communicate thru the network). To send data in an hexadecimal format type $ followed by two hexadecimal digits (for example $00,$01,$0A,$48,$FF).

According to the Enable_Log_File flag, a log file can record all characters which appear on the Wsplug window.

The flags Send_And_Close, Show_Received_Command, and Execute_Received_Commands, are interpreted as in the Server case. Their use are not recommended.

Timeout.

Wsplug manages up to 25 channels (a channel is defined as a potential connection between Wsplug and on other Internet agent), each of them is identified by a number between 0 and 24. A channel is associated with a state, for security reason a busy channel can't stay in a given state more than a fixed amount of time. Six states are defined.

Free State.
The channel is not connected. No timeout is associated to this state.

Pre Waiting State.
A connection is in progress, but the channel is not yet connected.
A Pre_Waiting timeout is associated to this state.

Waiting State.
The channel is connected, and waiting or receiving data. A Waiting_Timeout is associated to this state which is ignored if Enable_Timeout is reset.

Sending State.
The channel is connected, and due to a previous command, is sending a file to a remote client. A Sending_Timeout is asociated to this state, which is ignored if Enable_Timeout is reset.

Leaving State.
The channel is either in the process of disconnecting or disconnected. The Leaving_Timeout allows a "gracefull" disconnection, before entering the free state.

Purging State.
The channel has been informed of the disconnection of the remote end. The Purging_State_Timeout allows the channel to perform sanity check, to avoid the loss of previously received data. If there is no data to save, the channel enters the Leaving State before the timeout occurence .


Sending_Timeout
Sending Timeout: Maximum time to send a file.


Copyright
Wsplug, version 3.4

Copyright ©1995,1996,1997
Pascal Urien,Dominique Bolignano

 All Rights Reserved

This program may be distributed freely,
 for any non commercial purposes.
Please, register if you use Wsplug more than 30 days,
by registering Wsplug you are ensuring continued
development and support of Wsplug.
You will receive a personnal license number
to confirm your registration.
Fee: 10$
Special licences are available
for educational purposes.

For commercial use,
 more information or suggestion,
please mail to 100666.2766@compuserve.com.

The information provided is provided as is, without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. In no event shall Pascal Urien or Dominique Bolignano be liable for any damages, whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages, even if Pascal Urien or Domininique Bolignano has been advised of the possibility of such damages. In any case liability will be limited to the amount of money received from you for the use of this program.


configuration
SERVERS MODELS

HTTP SERVER, http model
Send_And_Close: On	Binary_Mode: Off
Show_Received_Data: On	Show_Received_Commands: Off
Echo_Keyboard_to_Clients: Off	Execute_Received_Commands: On
Text_Mode: On	Mode_Duplex: On
Enable_Timeout: On

PROXY SERVER, proxy model.
Send_And_Close: Off	Binary_Mode: Off
Show_Received_Data: On	Show_Received_Commands: Off
Echo_Keyboard_to_Clients: Off	Execute_Received_Commands: Off
Text_Mode: On	Mode_Duplex: On
Enable_Timeout: Off

STANDARD SERVER, standard model.
Send_And_Close: Off	Binary_Mode: Off
Show_Received_Data: On	Show_Received_Commands: Off
Echo_Keyboard_to_Clients: On	Execute_Received_Commands: Off
Text_Mode: On	Mode_Duplex: On
Enable_Timeout: Off

CLIENT MODELS

STANDARD CLIENT, standard model.
Send_And_Close: Off	Binary_Mode: Off
Show_Received_Data: On	Show_Received_Commands: Off
Echo_Keyboard_to_Clients: On	Execute_Received_Commands: Off
Text_Mode: On	Mode_Duplex: On
Enable_Timeout: Off

HTTP TEXT CLIENT, http text  model
Send_And_Close: Off	Binary_Mode: Off
Show_Received_Data: On	Show_Received_Commands: Off
Echo_Keyboard_to_Clients: On	Execute_Received_Commands: Off
Text_Mode: On	Mode_Duplex: On
Enable_Timeout: Off

HTTP BINARY CLIENT, http binary  model
Send_And_Close: Off	Binary_Mode: On
Show_Received_Data: Off	Show_Received_Commands: Off
Echo_Keyboard_to_Clients: On	Execute_Received_Commands: Off
Text_Mode: Off	Mode_Duplex: On
Enable_Timeout: Off


Waiting_Timeout
Waiting Timeout :  maximum time for receiving or waiting data.


Connection_Timeout
Connection Timeout : maximum duration of a connection.


Leaving_Timeout
Leaving Timeout: Maximum time for gracefully disconnection.


Purging_Timeout
Purging Timeout: maximum time to check that no data is  waiting in the receive buffer, after a disconnection.


PreWaiting_Timeout
PreWaiting Timeout : Maximum time for a client, to perform a connection to a server.


Server

First  you must define a server  configuration model.
Http	for Http ("Web") server
Proxy	for proxy server
Std	for standard server
Panel	for using the configuration menu setting

If the Http mode is set you can select the Http standard reference (either 0.9 or 1.0). The recommended value is 1.0.

A server directory is required  (home directory, where files are located).

The server port must be indicated (a number, between 0 and 65335).

If Http model is selected, a  mailbox  name (mailbox for example) has to be defined.

The production of a LogFile is enabled by setting on the LogFile flag.

The ServerProxy function is enabled by setting on the ServerProxy flag, you have to define in this case a proxy  port and a proxy host.

The connection is opened, by pressing the open button.

About proxy ...

Proxy function acts as an active relay between a client and a server. Client is connected on Wsplug Server Port, while Wsplug is connected to the Proxy Port of the Proxy Host. Data exchanged between the client and the Proxy Host can be recorded in a file by Wsplug.


Client

A configuration model has to be defined.
Std, a standard client.
Http Text, an http client, incoming documents are echoed to the screen.
Http Binary, an http client, incoming documents are memorised in the LogFile.
Panel, the configuration menu is used.

The production of a LogFile is enable by setting on the Enable_Log_File

The port used for connection (0...65535) has to be defined.

A target host must be specified.

Connection is opened by pressing the open button.

How to get an HTML document.

Select the HttpText  if you want to see the document in a text format, or HttpBinary to save it in a file.

Manual method

To execute an URL like http://kuhttp.cc.ukans.edu/lynx_help/HTML_quick.html, perform the following operations:
Connect to host kuhttp.cc.ukans.edu.
Wait for the "Login" message
Using the command item of wsplug menu, type :
GET    /lynx_help/HTML_quick.html.
Then press the OK button.
Use the statistics box to monitor the transfer.

Automatic method.

Use the URL dialog box.


Statistics

The statistics box displays :

the state of all the available channel (State)
the duration of the current connection (tCNX)
the duration of the current state (Time)
             the number of Rx bytes
the number of Tx bytes
             the IP address of the remote connection side
             the Port number of the remote connection side


command
Command Facility

This box is used to type a command, which can be echoed to the remote connection side, according to the Echo_Keyboard_To_Clients flag.


url
URL - Page Fetcher

This box is used to send an http request to a remote server.
InText mode the received document is displayed in the Wsplug window.
In Binary mode the document is saved in a pre-defined directory.
The "connectionTimeout" parameter specifies the maximum time allocated to perform this operation.
It may be necessary to adjust the value of the PreWaitingTimeout (maximum time for connecting Wsplug to a server, default value = 60 seconds).

Html page renaming

Wsplug includes two options for renaming the html pages, "AutoNameFile" and "UsePrefix".
-  With "AutoNameFile" wsplug tries to find a dos name similar to the original page name, and adds an index yz to this name.
- With "UsePrefix" all files are named as PREFIXyz.ext, PREFIX*.* defines in this case all the  documents found in a N_Order research.
- The (yz)  index field is used by wsplug fo renaming html pages. It is a two characters field, each character has a value between 0,1,2,...8,9 or a,b,c,...,x,y,z

URL encoding

The 'http://'  prefix is implicit, you only need to enter the other URL part (something like www.host.edu/home.html ...).
If the destination port is not equal to 80, it is encoded as :port, for example www.host.edu:6732/home.htm).

HTTP Version

The oldest HTTP version is known as 0.9. When selecting this mode wsplug uses a "Simple Request". Upon receiving a "Simple Request" a server sends the requested document without adding any header.
The new HTTP version (1.0 or later) supports "Full Request". Upon receiving a "Full Request" a server adds  additionnal information (which includes in particular the data length) to the requested document.

Directory

The directory where all incoming files are saved

(Url) Browser

This button is used to select and Url included in a file (whose name typically ends by .htm), located somewhere on your disk.

ProxyHost

For security reason, you may use a proxy server if your PC is connected to an ethernet network. Enter the proxy IP address or name in this case.

Port

The port number associated to a ProxyHost, if a proxy host is used.

Text-Binary

Binary mode is the normal option for this Wsplug function. Text mode can be used for test purposes.

URL-Max

This is  the maximum number of Http (.html) documents than you can get.

Images-Max

This is the maximum number of  images (typically .gif files) than you can get .

OK Button

When this key is pressed an http request is sent to a remote server.

OK+IMG Button

This feature is available only in binary mode. The http document and all associated images (typically .gif files) are saved as DOS files in the selected directory. You can use you favourite browser to display the html document.

Bookmark - The Directory Page - WSDIR.HTM

All wsplug requests are recorded in an html page typically  named wsdir.htm and located in the directory specified in  the Url dialog box. This document can be used by your favorite web browser, or by the wsplug url browser. You will find in this page usefull informations like original url, file name on your disk, filelength and operation status.

Level N

This powerfull feature allows you to get a set of html documents. By definition the order of a first html document is 0, all the html pages pointed by this document are called first order pages, and so on...
If the host name part of URL (http://host/...) is equal to 2mypc, then the first html page is located on your PC (http://2mypc/path/file.htm is an alias of the local file c:\path\file.htm).

See the "2mypc" topic, for more details.

A level_N request with N=1, will give you all the html pages pointed by your first URL. You can restrict your research to the 'local html' pages references (LocalOnly / All switch, relative_URL).
You can select an order between 1 and 99.
The http documents and all associated images (typically .gif files) are saved as DOS files in the selected directory. You can use you favourite browser to display again these html documents.

Local-All-SamePath-DownPath

When "All" is selected all html documents pointed by an html page are requested.
With "Local" only the documents located on the same host are requested.
With "SamePath" only the documents located on the same host with the same path are requested.
With "DownPath" only the documents located on the same host with a same or down path are requested.

Check Html Header.

Checks that the incoming document is an html page, before browsing (only with http 1.0)

Add Page Trailer.

Adds a trailer to each html pages, for registered version only (value is on for unregistered version).


save
Save Options

This dialog box save all the parameters used by Wsplug in the wsplug.ini file.


Ping

Ping tells you if a host is alive in the internet network.

Futhermore the blinking message "Alive" or "Timeout" is displayed under the Wsplug icon, when "Ping Auto" has been selected. This allows for example the user of an ethernet network to easily check that its gateway is alive.
To activate this facility you shall press "PING Auto", then "QUIT" and then  you shall reduce the Wsplug window.

Host

The host name or Ip address that you want to reach.

Data

You can add some ASCII data in your ping packet.

Show Echo

This option gives you more information about  ping packets.

Timeout

The maximum time that wsplug will wait for an answer to a previous ping packet.

Retry Number

The maximum number of retries (usefull only when "PING Once" has been selected).

Ping Once

A maximum of  Retry_Number ping packets will be sent to the destination host.

Ping Auto

Non stop ping process.

Stop

Ping process is stopped

Quit

The ping dialog box is closed, but if selected the ping process is alive.


pHost
The host name that you want to ping.


pData
You can add some ASCII data in your ping packet.


pShowEcho
This Flag gives more information about ping packets.


pTimeout
The maximum time that wsplug will wait for an answer to a previous ping packet.


pRetryNumber
The maximum number of retries (usefull only when "PING Once" has been selected).


pPingOnce
A maximum of  Retry_Number ping packets will be sent to the destination host.


pPingAuto
Non stop ping process.


pStop
Ping process is stopped


pQuit
The ping dialog box is closed, but if selected the ping process is alive.


uHttp
An http request.


uPort
The proxy port, if a proxy is used.


uDirectory
The directory where all incoming files are saved.


uProxyhost
The proxy name, or IP address, if you need a proxy server.


uConnectiontimeout
The maximum amount of time to get a file.


uPurgingtimeout
Maximum time, for sanity check, while disconnecting.


uLeavingtimeout
Maximum time for gracefully disconnection.


uUrlmax
The maximum number of http pages, than you can get (Order N).


uImagesmax
The maximum number of images than you can get (Order N).


uOK
Get a document, without the associated images.


uOkimg
Get an http document and the associated images.


uText
Http document is displayed on screen (for test only).


uBinary
Http document is saved as a file.


uStop
This button cancels a request in progress.


uCancel
Quit  this dialog box.


uLeveln
This button is used to get a set of http documents.


uLevelnv
The order of http documents research.


uLocalonly
This option will get only the local (referring to the same host) url included in http documents.


uAll
This option will get all the URL included in an http document.


csendandclose
Send a file, then close the connection.


cshowrxdata
All incoming data are displayed.


cechokeyboardtoclients
Each key pressed is echoed to remote client(s).


ctextmode
Text mode is selected.


cbinarymode
Binary mode is selected.


cshowrxcommands
Incoming commands are displayed.


cexecuterxcommands
Incoming commands are executed (only GET is recognized).


cmodeduplex
Duplex mode is enabled (always set).


cenabletimeout
To enable all timeout values.


cmaxclients
Maximum number of clients, connected to a server.
A value between 1 and 25.


2mypc
2mypc facility.

http://2mypc/path/file.htm

To experiment this facility, try
http://2mypc/wsplug/sockprog.htm

This facility allows you to use a local html page (a .htm file),
 as a starting point for a N_Order research (N_Order = 1, 2, ...).

The local file is described by the URL http://2mypc/path/page.htm,
where path is the complete description of the file page.htm,
 located in your hard drive (c:)

In page.htm only the absolute_URL(s)
(encoded as < A HREF="http://host/path/file.htm">)
will be requested by Wsplug.

Remarks.
a- the switch local/all, must be set to all
b- a particular field located in wsplug.ini ([Url], file:=) defines the disk name (default value is file:///c|).

Examples

If a file start.htm is located in the directory c:\rep1\rep2, the URL :
http://2mypc/rep1/rep2/start.htm  (with Order_N = 1)
will perform the following operations:

- The file start.htm is copied in the directory used by wsplug (\tmp),
  and will be typically renamed 01start.htm (relative URL may be modified,
  in order to keep local link(s)).

- If the file contain two absolute URLs, then Wsplug will perform two
  requests, in order to get the two missing http pages.


relativeURL
A relative URL, refers a document located on the same host.
It's encoded as <A HREF="/path/file.htm">a name </A>.


absoluteURL
An  absolute URL refers an external html pages, which is not located
on the same host.
It's encoded as <A HREF="http://host/path/file.htm"> a name </A>


How to register

You can register through Compuserve's SWREG forum,
GO SWREG, Registration ID: 9874
Program Name: WSPLUG Version 2.0

Mail to 100666.2766@compuserve.com if you can't reach Compuserve's forum.

By registering you will get a personnal license number.


cgi
What is CGI ?

CGI (common Gateway Interface) is a way of running programs from a web server. A client sends an URL that causes the server to launch a program, which outputs data  (html page in fact) back to the client.

As a web server Wsplug is able to launch any 16 bits program, to wait for its completion, and then to send its data  back to the remote client.

CGI parameters in wsplug.ini

Two parameters specifies how wsplug works with CGI (section =[CGI])
CGIMax (1...25) is the maximum number of CGI programs simultaneously working.
CGISynchro (0=no, 1=yes) specifies if a channel waits for the completion of a CGI program.
When CGIMax=1 and CGISynchro=1 only one CGI program can run at the same time.

How to launch a program thru CGI
The CGI-DOS.map file.

The first step is to describe the CGI program in the file CGI-DOS.map.

-  A line which begins by the star (*) character is a comment line.
- A line which doesn't begin by (*)  is a definition line associated with a CGI program.

The first word of a definition line is the alias name (from the client side) of the CGI program, an alias name always begins by the prefix cgi-dos.

The second word (yes or no) of a definition line stipulates if the CGI program outputs data back to the client. For example the program cgi-dos2 sends back an html page, while the program notepad.exe sends nothing back to the client.

The third word (yes or no) of a definition line stipulates if the system shows the working window of the CGI program, it should be usually set to "yes" (for security reason).

The fourth word is the complete path and name of the CGI program in your PC (for example \windows\note-pad.exe). In this Wsplug version the CGI program is lauched by the WinExec API.

The other (optional) words in the definition line defines an extra_parameters_list used for running the CGI program.

How the CGI program is launched.
chx_yz file, chx_yz.url file, chx_yz.tok file

The CGI program is launched with the following command line:

program_name chx_yz  extra_parameters_list   remote_parameters_list

where:

* program_name is  the CGI program name,  as defined in the definition line.

* chx (x=0,1,...,25) is the name of the (http) calling channel, yz is a number between 00 and 99. The file chx_yz can be used by the CGI program to output its data (wsplug creates a file chx_yz, with a null length). The CGI program must write in the file chx_yz.tok (created by wsplug with a null length) the name of the file which will be sent by the web server to the remote client. The use of the program vcopy.exe (included in wsplug.zip package) is strongly recommended to write the CGI output file name in the chx_yz.tok file (for example vcopy ch0_57  ch0_57.tok, if ch0_57 is the output file used by the CGI program). chx _yz is omitted in the command line when the CGI program outputs no data back to the client.

* The extra_parameters_list  is an optional parameter list defined in the definition line.

* The remote_parameters_list is the list of parameters defined by the remote client (typically by the mean of an html form).

The complete client request is saved by wsplug in a file named chx_yz.url, which can be used for specific purposes.

Rules for running DOS programs

A- If  you are using windows 3.1, the share utility must be installed.

B- The name of the CGI program output file must be written in the chx_yz.tok file by the mean of vcopy.exe (included in the wsplug.zip package).

C- If the CGI program modifies an html file (.htm)  which can be accessed by other (web) clients, this file must be modified by scopy.exe (included in the wsplug.zip package).

D- If  multiple intstances of a CGI program use the same file, the file accesses must be locked (and unlocked) by test&set.exe and test&rst.exe (included in the wsplug.zip package).
Suppose that your CGI program increments a counter, located in the file count.txt. You can use a file named count.tok to lock the accesses to count.txt .
If the file count.tok is empty the command "test&set count.tok busy" will lock further access to count.txt by writting the word busy in the file count.tok. If the file count.tok contains something test&set.exe  will wait.
When the count.txt file has been modified, test&rst.exe resets the count.tok file.

An example, CGI-DOS-ADD

As shown by the cgi-dos.map file, cgi-dos-add is the alias name of the CGI program addone.pif. This program outputs data back to the client, and wsplug shows its working window. This program is launched thru an URL like http://your_host_name/cgi-dos-add?.
Addone.pif is a way to run a DOS program under windows, the dos program name is addone.bat.
addone.bat is a batch file which performs the following operations :
* line 1:  test&set  count.tok  busy
The file count.tok is used as a lock. the string "busy" is written in count.tok by test&set.exe if this file is empty.
* line 2: addoneto  count.txt
The program addoneto.exe adds one to the content of the file count.txt.
* line 3 :  copy      count.beg+count.txt+count.end  %1
This line builds an html page named  chx_yz (%1)
* line 4 : scopy     %1        count.htm
The content of the file chx_yz (%1) is moved in count.htm, using scopy.exe
* line 5  : vcopy     count.htm %1.tok
The string count.htm is written (by vcopy.exe) in the file chx_yz, which contains the name of the file to send back to the remote client (count.htm).
* line 6 : test&rst  count.tok
test&rst.exe reset the count.tok file which is used as a lock.
* line 7 : exit
end of the dos program.


cgi comment line
A line which begins by * is a comment line


cgiword1
The CGI Program alias name.


cgiword2
Does the CGI program output some data ?


cgiword3
Do you want to show or hide the CGI Program working window ?


cgiword4
The CGI program name on your PC.


cgiword5
Extra parameters (TT in this case)


lines 1 to 7 : comment lines
line 8 :
The dos program (%3) is launched with the parameters %4 %5 %6 %7. The program output datas are written in the file %1 (chx_yz).
line 9:
dos2html.exe builds an html page (chx_yz.htm) from the file chx_yz, %2 defines the paragraph used in this document (H1, H2 ...)
line 10:
the name of the output file (chx_yz.htm) which is sent back to the client is written in chx_yz.tok.
line 11:
End of the dos program.


retry_number
The number of retries (0...).


samepath
This option only gets the html pages with the same host and the same path.


downpath
This option gets html pages with the same host and same or down path.


autoname
With this option wsplug automatically renames html pages.


useprefix
With this option wsplug uses a prefix (max size = six letters) to rename html pages.


commandline
Wsplug command line.

Syntax:
 wsplug -option1 -option2 value2 ...option n
Options:
 -s, -ping, -server, -u, -ud, -n, -a, -p, -o, -t, -all, -local, -samepath, -downpath, -http, -sdir, -udir, -ubook, -sport

Option list

-s, showns the Wsplug working window.
-ping hostname, starts the ping function.
-server, starts the server function.
-u url, starts the url function, with an url (url == http://hostname/path/file.html).
-ud url, same as the -u function, but for debugging purposes.
-http 0 or 1, selects the http standard (0 <=> 0.9, 1 <=> 1.0)
-n dosfilename, this option is used with the -u option to start an url and then to same the result in a dos file (name == dosfilename).
-retry value, set the number of retries to value (0...).
-a, this option selects the autoname mode for the url function.
-p prefixvalue, this option selects the prefix mode for the url function.
-o value, this function sets the order value for the url function (0=html page+images, 1=order one ...).
-t value, this option sets the connection timeout for the url function.
-all, this option selects the "all mode" for the url function.
-local, this option selects the "local mode" for the url function.
-samepath, this option selects the "samepath" mode for the url function.
-downpath, this option selects the "downpath" mode for the url function.
-sdir, the server directory.
-sport, the server port.
-udir, the Url directory.
-ubook, the bookmark file name, generated in the Url directory (-udir)

Examples

wsplug -u http://hostname/path/file.html -n dosfile.htm -t 600

This command gets the file.html page and saves it in the file dosfile.htm, with a timeout value of 600 seconds.

wsplug -server -http 1 -sport 80 -sdir \wsplug

This command starts the server function using http 1.0, on the port 80, the directory \wsplug is used (-sdir \wsplug).

wsplug -ping hostname

This command starts the ping function.

wsplug -u http://hostname/path/file.html -http 1 -o 1 -p test -downpath -retry 5 -t 600 -udir \tmp -ubook book.htm

This command starts the url function (url == http://hostname/path/file.html), uses http 1.0 (-http 1), sets order to one (-o 1), uses the prefix test (-p test), selects the downpath mode (-downpath), enables five retries (-retry 5), with a connection timeout value of 600 seconds (-t 600). The directory \tmp (-udir \tmp) is used to store the requested documents, a bookmark book.htm (-ubook book.htm) is generated with this request.


new
This button resets the url field.


uBrowse
Url Browser

This dialog box is used to select an Url included in a file located somewhere in your system. If you enter the Url used to get this html page (http://www.host.com/path/file.htm for example) then the relative_URL are displayed (press the refresh button if necessary), otherwise only the absolute_URL are shown.
refresh button: updates the Url Browser using the reference Url.
Ref=Selected_Url button : uses the current selected Url as reference Url
Ref-Reset button : resets the reference Url
Add-to-Bookmark-file : adds the selected Url to a particular html page (wsbook.htm for example).


uIndex
A two character string used for html pages renaming.


uHttpVersion
The http version used (0.9 first version, or 1.0)


mime
Content Type.

In HTTP/1.0 a web server adds a header to the requested document.
Example:
Server: Wsplug/3.2
MIME-Version: 1.0
Content-Type: text/html
Content-Length: 883
->empty line
<html> -> 883 bytes of information.
</html>

 The field "Content-Type:" specifies the document type (for example file.html is associated to Content-Type: text/html, text is the Type and html the Subtype)

The associations between file extension and Content-Type are defined in wsplug.ini, in the [Mime] section. Extensions .htm, .html, .gif, .jpg, .jpeg are processed by wsplug itself.
Example:
[Mime]
txt=text/plain
bat=text/plain
exe=application/octet-stream
com=application/octet-stream
tar=application/x-tar
zip=application/x-zip-compressed
gz=application/x-gzip
z=application/x-compress
js=application/x-javascript
ls=application/x-javascript
ps=application/x-postscript
bmp=image/x-MS-bmp
tif=image/tiff
avi=video/x-msvideo
mov=video/quicktime
qt=video/quicktime
mpg=video/mpeg
wav=audio/x-wav
aif=audio/x-aiff
au=audio/basic
snd=audio/basic


uAdd
This button enables/disables the addition of a trailer to html pages.
For registered version only.


uCheck
Checks that an  incoming document is an html page before browsing.
(http 1.0 only).


uBookmark
The file which records all requested Urls


TagMap
The tag.map file

This file is used to program the Page Fetcher configuration. The Page Fetcher is used to get and rename usefull pieces of information pointed or included in an html page (images, html documents, applets ...).

A link is encapsulated in an  html element, which begins by a tag, for example <img is the beginning tag of an element which includes an image.

A particular attribute identifies the Url (http request) associated to the information, for example src= specifies the Url used to get an image.

Example 1:
<img src="ImageName.gif">, <img is the beginning tag, src= is the attribute used to specify an Url.
Example 2:
<a  href="page.html">, <a is the beginning tag, href= is the attribute used to specify an Url

Url And Images
Wsplug tracks two kinds of informations: images (abreviated by I) and other Urls (abreviated by  U). Both images and Urls are identified by two elements  a Begin Tag and an Attribute.

Marking Documents.
Wsplug marks incoming pages, marking a document means that local Url (like href="aPage.html) are converted to absolute Url (like href="http://www.host.com/aPage.html"). Url are automatically marked, Images are not marked by default. If necessary some additionnal html element are marked, like the action associated to a form (an absolute Url is associated to the submit button).. Mark is abreviated by M.

Hidden Tag
Some html tags must be hidden for local use of html documents, for example the tag <base must be hidden for local use (this is done by substituing <base by <!base).

Content of the tag.map file

; tag.map
***********************************************************
*  Mark/Img/Url * Begin Tag * Attribute   * Hide (Yes/No) *
***********************************************************
; Image Section
Image        <img        src=             No
Image        <body       background=      No
Image        <input      src=             No
; Mark Section
Mark         <form       action=          No
Mark         <base       nothing=         Yes
; Url Section
Url          <area       href=            No
Url          <a          href=            No

A line which begins by * or ; is a comment line. A non comment line includes four words.

word n°1 : the kind of operation Image, for getting an image, Url for getting a document, Mark for marking an html element

word n°2 : html element beginning tag, first character is always <.

word n°3 : the attribut located before the (hyper) link, last character is alway =

word n°4 : specifies if the tag must be or not hidden (N for no Y for yes), it's usual value is N.


speed
Server Speed Enhancement

First you must open a web server. Then go to Option/Configuration and do the following operations :
- invalidate the field Show Received Data
- set the Leaving Timeout Value to zero.


cspeed
Page Fetcher Speed Enhancement.

To enhance the Page Fetcher Speed you can set the  field Leaving Timeout located in the Url dialog box to a zero value. (Leaving Timeout = 0).