我的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)