RO SDK / DataAbstract through a proxy server?

Hi,

[Delphi 10.1 + latest ROSDK + DA]

Has anyone managed to connect from a client to a custom Delphi DA server through a proxy?

I’m using CCProxy for testing and so far I’m hitting all sorts of weirdness.

I’m using TROIndyHTTPChannel client-side. I’ve completed all the proxyparams fields & added an OnProxyAuthorization event handler (just in case the old bug was still lying around) & added idAuthentication to the uses clause.

My client appears to be able to log in okay (SimpleLoginService) and accesses the list of users in from the USERS table in the SQL Server database okay.

On the client, after a login, the next thing I do is call a custom method on the dataservice – at which point I get a SQL Server error message saying it’s “unable to login to database ‘SW39’. Login Failed”

Here’s the thing - my database isn’t called SW39 (& I’ve never had a database called that)
Plus, the method is just a simple test method returning a string - it doesn’t access the database.

(The data service has RequiredSession = False)

I’ve so far not been able to even trace the entry point in the server. I put a breakpoint on the method implementation but it doesn’t get as far as that.

Anyone got any ideas how I could progress this, as I’m really stuck?

Cheers

update

I’ve tried WinInetHTTP channel & NetHTTPClientChannel and neither seem to want to use the Proxy server despite it being configured into IE. (Hence the connections work okay, but don’t go through the Proxy)

can you describe this bug, pls?

it works finely with WinInetChannel.AccessType = atPreconfig and preconfigured proxy in IE.
TRONetHttpClientChannel doesn’t support proxy because THTTPClient also doesn’t support it.

can you create a simple testcase that reproduces this, pls? you can attach it here or send directly to support@

See the answer to this question:

It states that TidHTTP client won’t process 407 responses, even if hoInProcessAuth is set in HTTPOptions, unless there’s an event handler for OnProxyAuthorization. This may have been fixed as question was 3 yrs ago, but I’m just covering my bases. :slight_smile:

I was using atPreconfig but WinInetChannel was going directlty. I turned off my proxy server to test and even though IE couldn’t connect (gave proxy not responding error) the app was able to connect using WinInet which was configured to use proxy. I might try using atProxy specifically.

Ah, I thought NetHTTP would use a proxy - well that explains that, thanks.

At the moment, when opening my client behind a proxy it fails to open a dataset (TDAMemDataTable.Open) and raises this error. Like I said, I have never had a database called ‘SW39’ ??

This is with an IndyHTTPChannel properly configured for proxy access ( the loginex works fine ).

Can you give me an idea as to where to start debugging this on the server end – I’d like to find out where SW39 comes from??

Thanks

you are using ODBC driver. launch odbcad32.exe and check that you have no preconfigured odbc DSN.
also you can have preconfigured FireDAC definitions. launch FDAdministrator.exe / FDExplorer.exe and review their configs.

server-side, set breakpoint at TDAEFireDACConnection.DoApplyConnectionString (uDAFireDACDriver.pas) and validate that everything is set correctly.
also you can set breakpoint at TDAEFireDACConnection.SetConnected

validate my options of WinInet channel:

Thanks for that information - there’s no connections in ODBC or FireDAC connections with databases by that name.

Thanks for the information, hopefully that should help.

Thanks - that was very helpful. I did exactly what you did in your screen gif & I noticed that your target URL is an IP address whereas I was using a host name :-

Blackbox & 192.168.0.27 are the same machine.

Can you verify the same at your end?

Thanks - this is helpful :+1:

it works as expected with host name too

Okay, strange.

This is my experience… am I doing anything wrong here?

Hi Evgeny,

Thanks for your help. I had the “Bypass proxy server for local addresses” ticked in my Internet Options / Connections.

Once I untick this the domain name URL’s work okay, if I tick it again they fail. You might want to confirm that your end too?

Is this an issue with IE or TROWinInetHTTPChannel?

Thanks

it can be a logic of WinInet.

from Internet Explorer uses proxy server for local IP address - Browsers | Microsoft Learn :

Symptoms
When you connect to a Web server using the Internet Protocol (IP) address or Fully Qualified Domain Name (FQDN) on the local network, Microsoft Internet Explorer or Windows Internet Explorer connects through an assigned proxy server even if the Bypass proxy server for local addresses option is turned on.

However, if you connect to a Web server using the host name (for example, http://webserver) instead of the IP address (for example, http://10.0.0.1) or FQDN (for example, http://webserver.domainname.com), the proxy server is bypassed and Internet Explorer connects directly to the server.

Cause
By default, only host names are checked when the Bypass proxy server for local addresses option is turned on.

Status
This behavior is by design.

Thanks Evgeny - great support =)