DVLP / signalr-no-jquery

120 stars 77 forks source link

Failed to execute 'open' on 'XMLHttpRequest': Invalid URL #16

Closed zdh8675 closed 7 years ago

zdh8675 commented 7 years ago

hello sir, please forgive my poor English first, when i run my program ,it comes the error:

image

1、I write a signalr selfhost by C#,and then run it: image

2、use signalr-no-jquery in my page:

`const connection = hubConnection('http://192.168.1.191:8068') connection.qs = { 'user_id': '5e6591de-35c8-11e5-ada2-000c2914e505' } const hubProxy = connection.createHubProxy('zdhHub')

  // set up event listeners i.e. for incoming "message" event
  hubProxy.on('CsBaoJing', function (strVal) {
    alert(strVal)
  })

  // connect
  connection.start({ jsonp: true })
  .done(function () {
    console.log('Now connected, connection ID=' + connection.id)
    hubProxy.server.joinGroupAsync('GroupBaoJing')
    // 组名为GroupOperator
    hubProxy.server.joinGroupAsync('GroupOperator')
    // 组名为GroupOperator
    hubProxy.server.joinGroupAsync('GroupNetworkDevice')
  })
  .fail(function () {
    console.log('Could not connect')
  })`

I do not know where the problem is,so,can you help me?thanks.