Monday, December 11, 2017

Running Kitto through a Proxy server

Did you know you can run a Kitto application through a Proxy server? Wonder why and how? This page just added to the Kitto wiki explains everything:

https://github.com/EtheaDev/kitto2/wiki/Proxy

Don't forget to pull the latest changes from the repository.

Friday, December 8, 2017

Zero-code WebBroker support

Just a quick note to signal that Kitto2 has just gained WebBroker support, which means new deployment options such as CGI, ISAPI and Apache modules.

Kitto-only WebBroker applications

Kitto's approach to WebBroker deployment is zero-code, meaning that you just need to create a standard WebBroker project through Delphi's wizard, choose the deployment option that you require, and then in the generated project ditch the auto-created empty WebModule unit and add Kitto.WebBroker.WebModule to the uses list. That's all.

Mixing Kitto with other services in the same application

Alternatively, if you want to mix the Kitto application with other services or for any other good reason you require to keep the generated WebModule, you just add the following code to the WebModule1DefaultHandlerAction event handler or to some other web action handler:

Handled := TKWebBrokerHandler.Current.HandleRequest(Request, Response);

Also add the Kitto.WebBroker.Handler unit. By the way, this unit will be useful if you need to integrate a Kitto application into any sort of existing application (as long as it is an HTTP server), provided you can manufacture the needed TWebRequest/TWebResponse classes.

Implementation status

This has required a complete reimplementation of session management in Kitto, which is now independent from Indy, more manageable and hopefully faster. The code still needs some testing (especially look for deadlocks and race conditions) and possibly a few refinements. This is currently being done, but you can start experimenting.

Saturday, December 2, 2017

Windows Services and latest developments

Among the recent changes to our Kitto2 repo is restored support for running a Kitto application as a Windows Service, which was disabled when porting the code from Kitto's previous life and has been just reimplemented and enhanced.

Running HelloKitto as a Windows Service

If HelloKitto.exe is not run by an administrative account, it will default to running as an application. Otherwise, it will run as a service and interpret the -install and -uninstall command line switches (you can also use slashes instead of dashes) to register and unregister the service in the Service Manager. From then on, you just start and stop the service from the Control Panel (by default, it's an auto-start service but you can change this and other parameters through the new Service section in the Config.yaml file.

Note

You can run HelloKitto as an application even when running it from an administrative account, by passing the -a command line switch.

The same applies to all Kitto applications, of course. No changes needed to application code or project files.

Kitto.Start.pas

A Kitto application can run as an application or service (and soon also command line application and Linux daemon) off the same compiled executable with the same project file code. All the intricacies are encapsulated in the Kitto.Start.pas unit; you just need to call Kitto.Start as the sole code in your project file and the rest will be taken care of.

Going forward

As we add more deployment options to Kitto (mainly ISAPI and Apache module), a separate project file will be needed for each one, as Delphi project files for programs and libraries are structurally different; we will aim to keep the required code in the project file to a minimum anyway.

A huge internal refactoring has just taken place to allow new deployment options to be implemented soon in an easier way. Specifically, the TKWebServer class was split into an HTTP server class that handles requests and responses and an engine class (which is a route) than handles sessions and controls the TKWebApplication class which is the heart of a Kitto application (and itself a route). The route subsystem has been refactored as well to allow route composition through the TKWebRouteList class.

Monday, September 25, 2017

KIDE is now Open Source


That's right. The entire Delphi source of KIDE, the Integrated Development Environment that makes writing and maintaining Kitto applications easier, was just added to Kitto's git repo.

You can download and build the code with Delphi XE8, 10.1 or 10.2. It shouldn't be difficult to build it in other (modern) versions as well. If you do, please share your changes through a pull request.

Kudos to Ethea for releasing the code.

Thursday, September 21, 2017

ExtJS 6 supported!

Let's try to reboot this blog once again. Work on Kitto has been going on without interruptions but the blog and other communication channels were unfortunately neglected.

So, we have news. Actually, quite a backlog of them. Let's start with the much awaited support for ExtJS's latest version, built into the new version of Kitto, called Kitto2.

More posts will follow about the huge architectural overhaul that is Kitto2. Meanwhile, you can download the source code and try the demos.