The organization of the HTTP tunnel on the example of utilities for working with MySQL
If you don’t know what an HTTP tunnel is, you’ll prefer a desktop application instead of a web interface to control MySQL and one of the following conditions is met:
you have access to the outside world only through an HTTP proxy
Your network has a restriction on the ability to work only with port 80
the hosting provider is allowed to work with the database only through lokalkhost
then this little note is for you. Actually, the purpose of HTTP tunnels is wider, including for security purposes. The scheme in general terms is as follows 1 : ')
Consider the organization of such connections on the example of HeidiSQL (or any other application):
Download and install (choose full install) GNU HTTPTunnel2 .
We extort the server part to the hosting (folder phpserver).
Open the admin _http: //domain.com/tunnel/admin.php and set up authorization, logs and other options. You can simply manually edit the cfg.php file. For authorization, you still need to rename the file htaccess.txt to .htaccess
We start client HTTPTunnelPath \ client \ httptunnel_client.exe
Open the _http: // localhost: 1079 / admin panel and configure the port mapping. Add for example:
3000 -> your_mysql_server.com.73306
Those. all requests for the 3000 port of locale will be redirected through the HTTP tunnel to port 3306 of your database server.
On the Tunnel Server tab, we specify the URL to the server side of the tunnel, authorization data and proxy (if necessary).
Now, in HeidiSQL, instead of your_mysql_server.com.73306, we specify localhost: 3000. The rest of the settings you need to be known.
If the developers have taken care of the connectivity through the HTTP tunnel, then it is even easier to organize it. Take, for example, dbForge Studio for MySQL :
It is necessary to download the tunnel.php script (which is the server side of the HTTP tunnel) to the server of the hosting provider. I advise you to restrict access to the script on the server using .htaccess.
On the “HTTP” tab of your connection, specify the URL of the tunnel.php script and other necessary settings: login, password (if access to the script is limited) and proxy (if the connection is made through it). The rest of the settings you need to be known.