Page 1 of 1
Help with http tunneling parameters?
Posted: Wed 14 Jan 2015 15:22
by docH
I am experimenting with http tunneling from Delphi into a MySQL database on my domain but am not sure that I have the server name and proxy server details correct as I keep getting the eror 'Cannot connect to server on host 10.0.0.1: Connection timed out'
I am using the MyDAC component and am following the instructions here
https://www.devart.com/mydac/docs/index ... eling.htm.
I've successfully put tunnel.php on my site.
Browsing to
http://MyDomainName.co.uk/tunnel.php gives me a confirmation message from php
Browsing to XXXX.myisp.co.uk displays the index.html page on my web site, just like browsing to
http://MyDomainName.co.uk
I've no idea why Hostname is '10.0.0.1' or even if that s correct
(MyDomain and XXXX.myisp.co.uk are not the real ones obviously)
Please could you tell me where I am going wrong with these connection parameters - particularly the proxy hostname.
Code: Select all
MyConnection.Server := 'XXXX.myisp.co.uk';
MyConnection.Port := 3307;
MyConnection.Options.Protocol := mpHttp;
MyConnection.HttpOptions.Url := 'http://MyDomainName.co.uk/tunnel.php';
MyConnection.HttpOptions.ProxyOptions.Hostname := '10.0.0.1';
MyConnection.HttpOptions.ProxyOptions.Port := 808;
MyConnection.Username := 'XXXXXXXX'; //correct one for a db user
MyConnection.Password := 'xxxxxxx'; //correct one for that user
MyConnection.Connect;
BTW
I write applications and SQL databases but rarely deal with domains, html, php etc so I may be misunderstanding what is meant by things like Proxy and server names. In this respect you may have to treat me like a complete newbie and not use big words!
Re: Help with http tunneling parameters?
Posted: Thu 15 Jan 2015 10:17
by ViktorV
The MyConnection.Server property contains the address of the MySQL server relative to the PHP server. If the MySQL server is on the same machine with the PHP server, then the MyConnection.Server property must be set to "127.0.0.1". MyConnection.HttpOptions.ProxyOptions are set only when there is no direct access to the HTTP server with a PHP script and a proxy server is used for access in the network (it must be installed and configured). If you have direct access to the HTTP server with the PHP script, you needn't to set MyConnection.HttpOptions.ProxyOptions.
Re: Help with http tunneling parameters?
Posted: Thu 15 Jan 2015 11:26
by docH
Thank you for the reply
the address of the MySQL server relative to the PHP server
I'm afraid I don't know how I would find that out
If the MySQL server is on the same machine with the PHP server
No idea - how would I find out?
Anyway I tried using 127.0.0.1 as suggested.
Code now looks like
Code: Select all
MyConnection.Server := '127.0.0.1';
MyConnection.Port := 3307;
MyConnection.Options.Protocol := mpHttp;
MyConnection.HttpOptions.Url := 'http://MyDomainName.co.uk/tunnel.php';
MyConnection.Username := 'XXXXXXXX'; //correct one for a db user
MyConnection.Password := 'xxxxxxx'; //correct one for that user
MyConnection.Connect;
but that gives me the error message
Failed to open _connections.id.php
If you have direct access to the HTTP server with the PHP script
No idea - how would I find out?
Browsing to
http://MyDomainName.co.uk/tunnel.php showed the following so it looks like the php script is working.
Code: Select all
Devart HttpTunnel v1.66
Tunnel script is installed correctly.
You can establish connections through the HTTP tunnel.
Re: Help with http tunneling parameters?
Posted: Thu 15 Jan 2015 12:50
by ViktorV
The tunnel.php script creates the _connections.id.php file on a server. Please try connecting to a server and check if such file exists on a server after this. If it doesn't, it means that this file is removed by some antivirus software or firewall. To solve the problem, you should set up the software correctly so it doesn't remove the _connections.id.php file.
Re: Help with http tunneling parameters?
Posted: Thu 15 Jan 2015 16:00
by docH
Interesting, that is word for word the same reply given two years ago by AndreyZ on Mon 13 Feb 2012 at 10:41 in response to a similar question by someone else "Problems with MyDac 7.1.4 and http tunneling"
Me smells boilerplate replies and that's a little disappointing.
As I said in my first post I am a newbie as far as server software is concerned so I'm afraid such a reply is pretty meaningless to me.
To solve the problem, you should set up the software correctly...
What software? How? Are you suggesting I have to somehow fiddle with the AV s/w used by my ISP?
I thought MyDac 'worked' using http tunneling. When I bought it there was no mention that I might have to set up some unknown software to ensure a file I've never heard of doesn't get deleted by someone else's firewall
*.
Still if you mean I should check for a file called _connections.id.php existing in my public html folder along with the tunnel.php that I put there manually, then I did check and it wasn't there.
What now?
* This was what AudreyZ said last year when I was enquiring as to whether I should buy MyDac or not
by AndreyZ ยป Wed 25 Dec 2013 07:00
If you cannot access your MySQL server directly, you can use HTTP tunneling to overcome this problem. For this, you should deploy the tunnel.php script (which is supplied with MyDAC) on the web server. It allows access to MySQL server using HTTP tunneling.
Re: Help with http tunneling parameters?
Posted: Fri 16 Jan 2015 10:16
by ViktorV
You have received my answer similar to the answer of my colleague AndreyZ, since it is a correct answer to the question about the appeared error. MyDAC provides capability to connect to MySQL http tunneling with no additional tuning, as well as any other software in case if no limitations are imposed (limited file system access rights, closed ports, etc.). In your case, the "Failed to open _connections.id.php " error may occur due to some limitations on the PHP server (an antivirus or firewall blocks creation of this file, file system access restrictions, etc.). Such server behavior doesn't depend on MyDAC and is not within our competence. To solve the problem, you should contact your ISP technical support.