小编Obe*_*ron的帖子

SignalR客户端Web可以连接不同PC上的服务器吗?

我的PC上有一个控制台应用程序,即signalR服务器.

我有一个html页面是互联网上的signalR客户端.但我尝试连接服务器,但我有一个错误的请求400错误.如果服务器关闭,我有另一个响应.

signalR客户端是否可以连接PC上的服务器?

(对不起我的英语不好)

我的页面

<input type="text" id="msg" value=" " />
    <input type="button" id="send" value="send" />
    <ul id="message">
    </ul>
    <script src="Scripts/jquery-1.6.4.min.js"></script>
    <script src="Scripts/jquery.signalR-1.1.2.min.js"></script>
    <script>
        $(function () {
            jQuery.support.cors = true;
            // Open a connection to the remote server
            var connection = $.hubConnection('http://MyIpAddress:8080');
            var chat = connection.createHubProxy('chat');

            chat.on('send', function (message) {
                $('#message').append('<li>' + message + '</li>');
            });

            // Turn logging on so we can see the calls in the browser console
            connection.logging = true;

            connection.start().done(function () {
                $('#send').click(function () {
                    chat.invoke('send', …
Run Code Online (Sandbox Code Playgroud)

c# http-status-code-400 signalr signalr.client

6
推荐指数
1
解决办法
1万
查看次数