Skip to Content
Author's profile photo Vladislav Volodin

How to use the public Relay Server in the network which is accessible through HTTP Proxy

The nature of the relay server is simple – you publish it in Internet, so everybody can access it from public networks to use SMP. It hides the internal network, and technically it is located in DMZ. In my case, I had the scenario when I needed to write a small SMP application to do the synchronization using relay server. When I want to access a web page in Internet, I have to use the proxy server (e.g. http://myproxy:8080), and I can easily set up it in the browser. Unfortunately, SMP SDK does not provide a capability to use proxy server during the connection, so I decided to use in a different way.

To implement such behavior, you have to download Apache server and configure it to be a proxy server. I will not describe the entire process, because it is not important. What is important are the lines that I used in the configuration file conf/httpd.conf:

LoadModule proxy_module modules/
ProxyRequests On
ProxyRemote * http://myproxy:8080
ProxyPass /
ProxyPassReverse /

For example, when if you use IIS as a proxy server, and you open it in the browser you should see the welcome image:


You should also see this image when you open the URL:  http://localhost/

If everything works as I described, the following code should work without any problems!

private const String HOST = "localhost"; // my local proxy, o
private const Int32 PORTMBS = 80;
ConnectionProperties connProps = app.ConnectionProperties;
connProps.ServerName = HOST;
connProps.PortNumber = PORTMBS;

You can also add additional parameters to the proxy configuration such as timeout or keep-alive. They can be helpful if the synchronization takes some time:

ProxyPass / KeepAlive=On
ProxyTimeout 60000

Please remember that I would recommend you to use such approach for development purposes only.

Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.