A-Shell supports the CGI (Common Gateway Interface), including the FastCGI variation, allowing it to act as a CGI script to deliver dynamic web content. Web programming is an involved topic and exceeds the scope of this guide, but perhaps the following overview of how this can work may help you get started.
The basic CGI framework is as follows:
| • | A client, which may be a browser, possibly JavaScript code within a web page, or any program capable of sending/receiving HTTP requests/responses, sends a request to the web server such as Apache, IIS, NginX, etc. |
| • | The web server (based on configuration options) executes the CGI script, passing it information from the request via the standard input (stdin) channel, possibly along with some environment variables. In the A-Shell case, the CGI script will actually be a bat or shell script that launches an A-Shell session with the -cgi or -cgifast switches and an appropriate startup command to process the request. |
| • | The A-Shell program receives the requested information, processes it, and sends back a response; this typically involving multiple CGIUTL calls. Depending on the type of request, the response might consist of a new web page (HTML document) to be displayed on the browser, or perhaps a JSON or XML document to be handled by a web service client. Depending on whether the web server interface is standard CGI or FastCGI, the A-Shell session will either terminate or loop back to wait for the next request. |
| • | The response is picked up by the web server and forwarded to the client. In the simplest browser case, the response is a new web page that the browser displays. In the JavaScript or generic cases, the response could be just about anything that both sides agree on. |
See the following subtopics for more details and examples.
Subtopics