CCI via TCP/IP

Please note that the TCP/IP CCI interface is being added at the time these notes are being written. The functionality may change after these notes are published. Updated information will be provided at the tutorial.

The TCP/IP CCI allows external applications to communicate with running sessions of NCSA Mosaic via TCP/IP. The CCI supplies programmers with the capability to communicate with Mosaic. Applications can use Mosaic to fetch URLs or ask Mosaic to report the URLs selected by the user. Applications can also pull in data from the web to the local program space, essentially turning the client program into a potential web browser itself.


Commands available

GET -- resolve a URL
DISPLAY -- display information in browser
POST -- forward data to server
SEND -- register a port for browser output
DISCONNECT -- application is disconnecting
QUIT -- browser shutdown

Return codes for commands

Each request to the browser is answered with a return code, consisting of a one line response. The line consists of a three-digit numerical value followed by an optional human readable description. The first digit of the numerical return code gives an overall status of the error, as follows:

1xx
Informative message
2xx
Command ok
3xx
Command ok, additional output follows
4xx
Client error: request has bad syntax, not authorized, etc.
5xx
Server (browser) error. Command unimplemented, cannot be performed, or a serious program error occurred.
x9x
Debugging output

Example connection response

     200  NCSA Mosaic/2.0.0b3 (Windows x86) CCI - connected

Description of commands

GET {URL|URN} <url> [OUTPUT {CURRENT|NEW|NONE}]
GET {URL|URN} <url> [OUTPUT {CURRENT|NEW|NONE}] HEADER
Content-Length: (length of additional header)
...additional header...

The GET URL command tells the web browser to resolve the given URL. The results will then be displayed in either the current window or a new window. Location of where the output is displayed is optional with the default being the current window.

If the output NONE is specified then the URL will not be displayed by the browser. It is intended that output will be sent to a registered output (see SEND OUTPUT ...). In this case the browser is used as a slave web resolver.

The URL is wrapped in angle brackets. For example:

     GET URL <http://yahoo.ncsa.uiuc.edu/mosaic/cci.spec> CURRENT

DISPLAY [OUTPUT {CURRENT|NEW}]
Content-Type: data type
Content-Length: (length of data body)
...data body...

The display command tells the browser to display the following data The data message begins following the <CRLF> after the Content-Lenth line.


POST <url> mimeType [OUTPUT {CURRENT|NEW|NONE}]
Content-Length: (length of MIME body)
...MIME body...

The post command tells the browser to forward the following MIME body to the specified HTTP server (URL).

The OUTPUT parameter to POST defines whether the output from the HTTP server should be displayed in the current window, a new window, or just sent back through the CCI port and not be displayed. If output is not specified the default action for the browser is to display the output in the current window. In the case where output is set to NONE and channeled back through the CCI port, it will take on the form of:

     302 POST output
     Content-Length: (length of data body)
     ...data body...

SEND
SEND ANCHOR BEFORE
SEND ANCHOR AFTER
SEND ANCHOR STOP

The SEND command is used to register a port address for information to be sent from the browser.

This message registers an address for activated URL anchors to be sent to. This registered address is intended to remain active until a SEND ANCHOR STOP message is sent.

Activated anchors include all anchor retrievals in the browser.

Output from the browser to the specified history port will be:

     301 ANCHOR <url>

SEND OUTPUT mimeType
SEND OUTPUT STOP mimeType

This command notifies the browser to send a specified MIME type. The recipient will then be responsible for displaying the output.

Output from the browser:

     302 Viewer output
     Content-Type: data type
     Content-Length: (length of data body)
     ...data body...

DISCONNECT

Notifies the browser that connecting applications will be exiting.


QUIT

This request tells the browser to shutdown. It is intended for clean up when the browser is used as a slave process and the master application is exiting or will no longer be using the browser.


WWW'95 Tutorial, Darmstadt, 10 Apr 1995
Briand Sanderson (briand@ncsa.uiuc.edu)
Tom Magliery (mag@ncsa.uiuc.edu)