You are not logged in.
Pages: 1
Hi,
Does mORMot2 support custom DNS? I want to select a suitable IP address for the Http Client in code.
For example: test.com resolves to 1.1.2.2 (which is either a faulty service or unreachable due to network issues) and 1.1.1.1 (which is still available).
In the current implementation, openbind seems connect to the first resolved address from the system, and there's no way to temporarily exclude 1.1.2.2 through code.
Offline
Thank you.
I looked into RegisterKnownHost, and it maps a specific domain name to a specific IP address.
What I actually want is to block certain IP addresses.
Let me give a more specific example: for test.com, if it resolves to 1.1.2.2, I want to avoid selecting it as the socket ip destination. But if it resolves to other IPs by DNS, I want to allow them and not processed.
Offline
Previously, I used Oberbyte ICS as the HTTP client, but unfortunately it doesn't support Lazarus, so I switched to mORMot.
There is an event in ICS's THttpCli:
TSelectDnsEvent = procedure(Sender : TObject; DnsList : TStrings; var NewDns : String) of object;
ref:https://svn.overbyte.be/svn/ics/trunk/Source/OverbyteIcsHttpProt.pas
This event will be triggered when the DNS resolve is done.
DnsList stores all IP addresses resolved by DNS, NewDns is the IP address selected by THttpCli to do future connection, I can modify it in the event.
Offline
Pages: 1