Team XSockets.NET

Configuration behind firewall

A common scenario is that you have your server on a machine behind a firewall and need to let traffic through. For this to work you have to create a configuration with a private and a public endpoint.

The private endpoint is your machine behind the firewall, and the public endpoint is the one that client use when connecting.

For example, if you want your users to connect to mydomain.com and your server is located on a machine with IP 192.168.1.2 you may do something like this.

using System;
using System.Collections.Generic;
using XSockets.Core.Configuration;

namespace XSocketsTutorial.Configurations
{    
    public class MyFirewallConfig : ConfigurationSetting
    {
        public MyFirewallConfig() : base(new Uri("ws://mydomain.com:80"),new Uri("ws://192.168.1.2:9090"))
        {            
        }
    }
}

So the client will connect to mydomain.com:80 and your server have an endpoint at 192.168.1.2:9090

Important

Ofcourse you have to setup a rule in your firewall to pass traffic from mydomain.com:80 to 192.168.1.2:9090

results matching ""

    No results matching ""