连接到SignalR主机 [英] Connecting to SignalR Host

查看:90
本文介绍了连接到SignalR主机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我是SignalR的新手,我已经自我托管了一个信号R

http:// localhost:8080

假设我的计算机的IP是192.15.15.15。我需要我的客户端连接到这个主机,IP地址如http://192.15.15.15/signalr但是当我尝试连接时我收到错误

错误请求 - 无效主机名

HTTP错误400.请求主机名无效。



以下行正常工作

http:// localhost / signalr。但是我必须用localhost托管它。

任何帮助都会受到赞赏,我很难坚持这个..

Hello,
I'm pretty new on SignalR, I've Self-Hosted a signalR at
http://localhost:8080
Let's say my computer's IP is 192.15.15.15. I Need my client to connect to this host, with IP Address like http://192.15.15.15/signalr but when I try to connect I get the error
Bad Request - Invalid Hostname
HTTP Error 400. The request hostname is invalid.

following line works fine
http://localhost/signalr. But I have to host it with localhost.
Any help will be appreciated, I'm badly stuck on this..

推荐答案

嗯弄清楚了。您需要做的就是在IP地址处放置一个*。因此托管信号服务器到这个IP地址。 https:// *;
Well figured it out. all you need to do is to place a * in the place of IP address. Thus hosting signalr server to this ip address. https://*;


无法从同一台计算机上运行的任何应用程序访问本地计算机IP地址。



如果你已经在IIS上发布了SignalR,然后使用你提到的IP地址,可以在局域网中访问服务器。



如果你想访问localhost在同一台计算机上,然后简单地用IP地址127.0.0.1替换localhost。此IP地址是为localhost保留的,仅供本地应用程序用于访问服务器。



有关localhost的更多信息,请参阅文章;

localhost - 维基百科,免费的百科全书 [ ^ ]
The local computer IP address is not accessible from any application running on same computer.

If you have published the SignalR on IIS, then using the IP address you mentioned, it is possible to access the server in LAN.

If you want to access "localhost" on same computer, then simply replace "localhost" with ip address "127.0.0.1". This ip address is reserved for localhost and to be used only by local applications to access server.

For more information on "localhost" go through article;
localhost - Wikipedia, the free encyclopedia[^]


这篇关于连接到SignalR主机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆