nitrogen

An interpreted programming language written in Go.


Project maintained by nitrogen-lang Hosted on GitHub Pages — Theme by mattgraham

Nitrogen SCGI Server

Like any other executable code, Nitrogen scripts can be used with CGI to generate dynamic web content. The Nitrogen interpreter goes one step further and supports Simple CGI or SCGI. SCGI allows the interpreter to always run and accepts multiple requests from another web server. Nitrogen does not currently support running as a stand alone web server. It needs something like Nginx or Apache in front if it to proxy requests. Using SCGI is more efficient since the operating system doesn’t need to create a new process for every request. Instead, all requests are handled in a single process.

Nitrogen supports concurrent requests meaning it can fulfill multiple proxy requests at the same time. The number of workers is configurable. By default, 5 workers are created to handle requests.

Flags

These are the flag given to Nitrogen to configure SCGI.

Scripts

The only change to normal script execution is any print statements will go to the client’s browser, not the process’s normal standard output. The _ENV variable will contain any CGI variables provided by the upstream web server.