C # SignalR connection problems

0

Let's see if someone can give me a cable.

I'm starting connection tests through SignalR, on the one hand I have a small console application in code c # which is what makes the server and on the other hand a Windows Forms also in c # which is the client.

The server starts with the following code:

string url = "http://localhost:8080";
using (WebApp.Start(url))
{
    Console.WriteLine("Server running on {0}", url);
    Console.ReadLine();
}

by the client starts:

string url = "http://localhost:8080/signalr";
var connection = new HubConnection(url);
var _hub = connection.CreateHubProxy("MyHub");
connection.Start().Wait();

All this works well if the 2 programs are on the same PC, but if the server program I put it on another PC in the local network. it does not work anymore, the url of the terminal changed it by http://192.168.1.14:8080/signalr , but it throws me the following error:

  

StatusCode: 400, ReasonPhrase: 'Bad Request', Version: 1.1, Content:   System.Net.Http.StreamContent, Headers: {Connection: close Date:   Tue, 13 Nov 2018 10:38:04 GMT Server: Microsoft-HTTPAPI / 2.0   Content-Length: 334 Content-Type: text / html; charset = us-ascii}

I have tried to disable antivirus firewalls, etc and nothing, I've been with this for several days and I can not continue, I hope someone has some solution. Thank you very much.

    
asked by Rikimartini 13.11.2018 в 13:12
source

2 answers

1

Well, I answer to myself in case someone has the same thing. In the url you must put the following: string url="http: // *: 8080";

    
answered by 13.11.2018 в 15:29
0

Make sure:

  • Have a rule in the firewall (to the port in question) or have it disabled.
  • Make sure you are running your application with Administrator permissions.
  • answered by 13.11.2018 в 13:44