In this part, the server application uses the Indy HTTP server uses SSE to continuously send events to the JavaScript EventSource. Part 3: the demo application, now streaming Ingredient #1: the HTML page with JavaScript The script has not changed, it reads two data items from the ping event: a time stamp in ISO 8601 … Continue reading How to: Server-Sent Events with Indy HTTP Server (part 3)
How to: Server-Sent Events with Indy HTTP Server (part 2)
In this second part, a server application uses the Indy HTTP server to provide a HTML page which uses SSE to update its content with data sent from the server. Part 2: the basic demo application, some client data added Ingredient #1: the HTML page with JavaScript The script now reads two data items from … Continue reading How to: Server-Sent Events with Indy HTTP Server (part 2)
How to: Server-Sent Events with Indy HTTP Server (part 1)
In this article, a server application uses the Indy HTTP server to provide a HTML page which uses SSE to update its content with data sent from the server. Server-Sent Events (SSE) is a server push technology enabling a client to receive automatic updates from a server via an HTTP connection, and describes how servers … Continue reading How to: Server-Sent Events with Indy HTTP Server (part 1)
Indy FTP LIST timeout with Delphi 11 in active mode (solved)
In the Indy issue tracker, a bug was reported which first appeared with Delphi 11. FTP LIST timeout with latest Delphi 11 (and idFTP) It is possible to reproduce the bug not only with Delphi 11 but also with Free Pascal. Reportedly the timeout also occurs with Delphi 10.4. If you want to reproduce it … Continue reading Indy FTP LIST timeout with Delphi 11 in active mode (solved)
How to: Let’s Encrypt certificates with Indy HTTP Server
This article guides you through the setup for a simple HTTPS server using Let's Encrypt certificates. Download the project source The example project is included in the Daraja demo folder at https://github.com/michaelJustin/daraja-framework/tree/master/demo/https. You may use the project IndyHttpsTest with Delphi 6 or later, or with the Lazarus IDE. This stand-alone project only requires the Indy … Continue reading How to: Let’s Encrypt certificates with Indy HTTP Server
Consuming Server-Sent Events (SSE) with Indy TIdHTTP and TIdEventStream
A new Indy HTTP client / JAX-RS server example is now available on GitHub. The server side generates Server-sent events. Server-sent events (SSE) is a technology enabling a browser to receive automatic updates from a server via HTTP connection. The example code uses TIdHTTP and TIdEventStream to connect to the server, and writes the incoming … Continue reading Consuming Server-Sent Events (SSE) with Indy TIdHTTP and TIdEventStream
Indy 10.6 HTTPS POST example with JSON body
The Indy (Internet Direct) TIdHTTP now creates a default SSLIOHandler when requesting an HTTPS url. This makes TIdHTTP a little easier to use "out of the box". (blog article). The code below sends a hard-coded JSON object as POST body to a secure url. Note: if you need to customize the SSLVersions used, or specify … Continue reading Indy 10.6 HTTPS POST example with JSON body
Indy HTTP server: multipart/form-data file upload example
The Internet Direct (Indy) 10 HTTP server class TIdHTTPServer does support HTTP file upload with multipart/form-data encoding. The solution below is based on code in the Indy and Delphi newsgroups. Please note that a patch in the Indy library is required, as shown on Stackoverflow in Indy MIME decoding of Multipart/Form-Data Requests returns trailing CR/LF. … Continue reading Indy HTTP server: multipart/form-data file upload example
Send secure SMTP email from Delphi applications
Introduction Sending email from Windows, Android and iOS Delphi applications over public SMTP servers requires an encrypted connection. Internet Direct (Indy) configuration for SSL/TLS connections is shown in this example source code. Disclaimer This code is mostly based on code posted in the Embarcadero forum and here. Example usage procedure TFormMailDemo.ButtonSendClick(Sender: TObject); var Mail: TSSLEmail; … Continue reading Send secure SMTP email from Delphi applications
Indy 10 TIdTCPServer: Server-side message push example
Get the source code on Github This example uses a Delphi 2009 VCL application with a main form, which contains only one visual component, a TMemo named "MemoLog". Client and server are both started in the FormCreate event. [sourcecode language="Delphi"] procedure TServerPushExampleForm.FormCreate(Sender: TObject); begin ExampleServer := TMyPushServer.Create; ExampleServer.DefaultPort := 8088; ExampleServer.Active := True; ExampleClient := … Continue reading Indy 10 TIdTCPServer: Server-side message push example