Limitations of TROHTTPFileDispatcher?

(Stuart Clennett) #1


I am planning on building an HTML/JS client for my custom Delphi RO/DA Server.

I have been developing a REST/JSon api using the Http API dispatcher, and I would obviously like to use this Rest API within my JS client app.

I wondered if it was possible or recommended to deploy the client by using the TROHttpFileDispatcher?

If so, are there any limitations in terms of JS functionality that can be used? I.e. can I use JQuery/Bootstrap or can I even use React/Vue/Angular … ?



(antonk) #2


It is. The purpose of TROHttpFileDispatcher is to serve static files, so a JS app can be deployed via it as well. However there are 2 things you need to to consider:

  1. TROHttpFileDispatcher still uses resources of the app server. So for high load it would be wise to use a separate specialized Http server for this (probably a nginx instance working in reverse-proxy mode or something similar)
  2. TROHttpFileDispatcher doesn’t support GZip-ing responses. So for html/js files it will produce more server->client traffic than a ‘real’ http server.

Http API handles JSON requests and provides JSON responses. So there shouldn’t be any restrictions for it to be used with any JS or TS code.

Note also that Http API produces OpenAPI server metadata that can be used to generate client-side code on

The main limitation is that currently Http API doesn’t support JWT-based authentication. It uses a custom token-based auth (similar to one used in desktop SDK applications).

And please note that Data Abstract methods are atm NOT supported by Http API. This means that you’ll need to provide your own wrapper over DA service to make it HttpAPI compatible.



(Stuart Clennett) #3

Hi Anton,

I am not familiar with the reverse-proxy concept, so I will look into this more – thanks.

However, the main reason for wanting to use HTTP File Dispatcher in the current server app, is because this is already installed at 30 customers and it would be an easier upgrade path to a web client than having to install other web server software.

Thanks, I did know that … I seem to recall it being something like having an access-token in the header of each request ?

This isn’t a problem as I have to migrate most of my code to a REST API anyway in order to provide an external API that conforms to required standards.

Currently still trying to decide which client framework, (if any).



(antonk) #4

I’d say that for 30 or even 300 customers the TROHttpFileDispatcher-based distribution will work perfectly (unless you’ll need to stream video or provide gigabytes of graphical content).

Yes. The process looks like receiving a token from server if the provided login/pwd pair is correct and then you’ll need to provide this token in the request headers when talking to the server.

Personal opinion below, do not consider this an official position
Vanilla (no framework) JS would be an overkill and a hell to support

Personally I would look at Angular + Bootstrap combination. Bootstrap provides an easy way to create UX while Angular does its job on routing, data binding etc. Also an important addition here is the TypeScript support. It is way more sane than JS, especially for someone who is used to OOP, static types and syntax sugar.


(Stuart Clennett) #5

Thanks for the clarification, my usage per installation will be below 50 users, no more than 10 concurrent. So I should be okay for the foreseeable future.

Thanks for that unofficial advice. I have looked at React and Vue so far, so may as well have a look at Angular too.

Thanks again :+1: