TIWProxyPortRedirection class allows to create HTTP/HTTPS responses which use a different port other than the one actually being used to receive the requests. This can be useful in some cases where IntraWeb application works behind a (reverse) proxy or firewall which receives incoming requests using a different port number.
Example:
- Apache Server used as a reverse proxy, listening to port 80
- IntraWeb listenign to port 8080 for incoming requests
Set:
- ServerController.ProxyPortRedirection.Active = True;
- ServerController.ProxyPortRedirection.HttpPort = 80;
This will make IntraWeb to generate responses as it was installed/listening to port 80. This enable the application to keep working on port 8080 transparently behind a reverse proxy installed on port 80.
It also allows user to force redirection from HTTP to HTTPS in ISAPI (it is much harder to do it using IIS built-in functionality).
When redirecting to HTTPS in ISAPI, this is how you should configure ServerController properties:
- ServerController.SSLOptions.NonSSLRequest = nsRedirect;
- ServerController.ProxyPortRedirection.Active = True;
- ServerController.ProxyPortRedirection.HttpsPort > 0
Unit
IWServerControllerBase
Class hierarchy
TPersistent -> TIWProxyPortRedirection
Methods
Create [Public]
Declaration: constructor Create;
Description: Constructs an instance of the class TIWProxyPortRedirection and initializes its data.
Assign [Public]
Declaration: procedure Assign(ASource: TPersistent); override;
Description: Copies properties values from another TIWProxyPortRedirection instance or TPersistent descendant.
Parameters:
- ASource (TPersistent): [param description]
Properties
Active: Boolean; [Published, Read/Write]
Enables/Disables the redirection
HttpsPort: Integer; [Published, Read/Write]
Port number used for HTTPS redirection. If zero, port redirection to HTTPS will be disabled.
HttpPort: Integer; [Published, Read/Write]
Port number used for HTTP redirection. If zero, port redirection to HTTP will be disabled.
|