SignalR use my IP

0

I am developing a console application that acts as a server using Signalr The idea is that users ask for information in real time to this server.

At the time of working with localhost everything works perfectly now I am trying to raise the server with my IP Code;

Server

    static void Main(string[] args)
    {
        string url =@"http://127.0.0.1:8080/signalr";//sustituir con mi IP
        using (WebApp.Start<Startup>(url))
        {
            Console.WriteLine(string.Format("Server running at {0}", url));
            Console.ReadLine();
        }
    }

Startup Class

class Startup 
{

    public void Configuration(IAppBuilder app)
    {
        app.UseCors(CorsOptions.AllowAll);
        app.MapSignalR();
    }
}

Connection to the client

 public void startComunication()
    {

        string url = @"http://localhost:8080/signalr"; //sustituir localhost con la ip correspondiente.
        var connection = new HubConnection(url);
        _hub = connection.CreateHubProxy("TestHub");
        connection.Start().Wait();
    }

At the time of changing the localhost for my IP I try to launch again the APP of the server and it gives me the following error;

    
asked by Hector Lopez 06.06.2018 в 14:48
source

0 answers