Indy library is an open source client/server communications library that supports TCP/UDP/RAW sockets, as well as over 100 higher level protocols including SMTP, POP3, IMAP, NNTP, HTTP, FTP, and many more. Indy is written in Delphi but is also available for C++Builder and FreePascal. sgcWebSockets uses Indy as a base for some components and the different sgcWebSockets Editions make a different use of the Indy library.
sgcWebSockets supports protocols like HTTP/2 which require the use of ALPN, can use TLS 1.3 using openSSL 1.1.1 or openSSL 3.0.0... all these features are not supported by the standard Indy library, so sgcWebSockets Enterprise edition includes a custom Indy library that supports these features. To avoid uninstalling the standard Indy library from the IDE, the required Indy files are renamed by adding the prefix "sgc", so for example: the unit "IdGlobal" is renamed to "sgcIdGlobal". This way, both versions can coexist without problems.
Find below which Indy version is used by every sgcWebSockets Edition:
| sgcWebSockets Edition | Indy Version |
| STANDARD | Standard |
| PROFESSIONAL | Standard |
| ENTERPRISE | Custom |
Customers with "Registered" licenses, which are old licenses from before the sgcWebSockets package was split, will find the following sgcWebSockets package versions:
| sgcWebSockets Edition | Indy Version |
| sgcWebSockets | Standard |
| sgcWebSockets min | Standard |
| sgcWebSockets min Indy* | Custom |
*The sgcWebSockets_min_indy is the same as sgcWebSockets Enterprise edition.
The use of the custom Indy version is defined in the file "sgcVer.inc" located in the source folder. There is a compiler define called "SGC_CUSTOM_INDY" which enables or disables the use of this indy version. If you have a Enterprise Edition and want to disable the use of the custom indy, just delete the following compiler define:
{$DEFINE SGC_CUSTOM_INDY}
Of course, if you enable SGC_CUSTOM_INDY but you don't have in the source folder the required custom indy version units, this compiler define won't work.
The use of the custom Indy version is not limited to the sgcWebSockets components. Some customers want to make use of the new features of this custom Indy version in standard Indy components like SMTP for example, so they can use TLS 1.3 when sending emails, using FTP servers, etc. The eSeGeCe ALL-ACCESS edition provides an additional full Indy package with all these features. This package, called "sgcIndy package", includes the full Indy library with support for openSSL 1.1.1 and openSSL 3.0.0. So you first must uninstall your current Indy library installed in your IDE and then install this version, the process to install the sgcIndy package is exactly the same as for any Indy library (here the units are not renamed).
When you want to use openSSL libraries, just set the global variable OPENSSL_API_VERSION to the desired OpenSSL API version before loading the OpenSSL libraries. This global variable is in the unit IdSSLOpenSSLHeaders.
Example: to use the openSSL 1.1.1 libraries
OPENSSL_API_VERSION := opSSL_1_1;
When using eSeGeCe ALL-ACCESS and the sgcIndy package in the same application, the sources may be duplicated because the sgcWebSockets Enterprise version uses a custom Indy version with the Indy units renamed. This means that, for example, units like sgcIdGlobal.pas and IdGlobal.pas will be compiled in the same application (the first is used when using any component of the sgcWebSockets Enterprise package and the second when using any component of the sgcIndy package, like ftp, smtp...).
To avoid this behavior, the sgcWebSockets package can be configured to use the installed sgcIndy version and still make use of all the components. To do this, follow the instructions below:
1. Open the file sgcVer.inc, located in the Source folder of the sgcWebSockets package.
2. Disable the compiler directive: SGC_CUSTOM_INDY. This option tells the compiler that the files starting with sgcId*.pas exist and must be used when compiling the sgcWebSockets Enterprise Package.
3. Enable the following compiler: SGC_INDY_LIB. This option tells the compiler that the sgcIndy package is installed and must be used when compiling the package.
{$DEFINE SGC_INDY_LIB}
Using the previous configuration, the sgcWebSockets Enterprise package will use the sgcIndy package that is installed and all the features that make use of this package (like http/2, IOCP, openSSL 3.0...) will be enabled.