Online Documentation for SQL Manager for PostgreSQL

HTTP tunneling options

HTTP tunneling is a method that allows one to connect to a database and transmit data between the program and a PostgreSQL server through the HTTP/HTTPS protocols using port 80 which is used by a regular Internet browser. This method is used to connect to the remote PostgreSQL server of a hosting company when direct connection is not available (e.g. for security reasons).


The HTTP tunnel works in the following way.

All outgoing queries and commands sent by the client's software are encoded and transmitted through the HTTP/HTTPS protocol using port 80 to the special script that decodes the received data, sends it to PostgreSQL server for processing and then sends the result back. This method requires the HTTP server (Apache) and PHP with PostgreSQL to be installed on the remote server. Normally this software is provided by a hosting company that offers Linux hosting solutions.


To use HTTP tunneling, just upload the tunneling script to the webserver where PostgreSQL server is located (e.g. to the location where other PHP scripts are stored), or to any other webserver from which direct connections to your PostgreSQL server are allowed. This script exposes the PostgreSQL API as a set of web-services used by SQL Manager for PostgreSQL.


If your webserver complies with the requirements and the script is installed correctly, you will see the message "EmsProxy v 1.31" (version can be different) in your browser when opening the http://<your_webserver>/emsproxy.php page.


In case of using this connection method the response will be slower as compared to the direct connection or the SSH Tunneling method, since the data are XML encoded and HTTP is stateless by nature. However, all the features of SQL Manager for PostgreSQL are available.


Note that the emsproxy.php script file is included into the distribution package and can be found in SQL Manager installation directory.


Appendix - HTTP tunneling options