hretic
hretic

Reputation: 1085

nodejs : unknown error when trying to talk to SignalR api

im trying to use this pakcage

https://www.npmjs.com/package/signalr-client

to talk with SignalR api written in c# , but i get some error just when i trying to create the client

here is my code

var signalR = require('signalr-client');

try
{
    var client  = new signalR.client(
        "https://firouzex.exphoenixtrade.com/realtime",
        ['GetNewAPIToken' , 'OmsClientHub']
    );


}
catch (e) {
        console.log('error');
}

but i get this error

Error Message:  Protocol Error
Exception:  undefined
Error Data:  Url {
  protocol: 'https:',
  slashes: true,
  auth: null,
  host: 'firouzex.exphoenixtrade.com',
  port: null,
  hostname: 'firouzex.exphoenixtrade.com',
  hash: null,
  search:
   '?connectionData=%5B%7B%22name%22%3A%22getnewapitoken%22%7D%2C%7B%22name%22%3A%22omsclienthub%22%7D%5D&clientProtocol=1.5',
  query:
   [Object: null prototype] {
     connectionData: '[{"name":"getnewapitoken"},{"name":"omsclienthub"}]',
     clientProtocol: '1.5' },
  pathname: '/realtime/negotiate',
  path:
   '/realtime/negotiate?connectionData=%5B%7B%22name%22%3A%22getnewapitoken%22%7D%2C%7B%22name%22%3A%22omsclienthub%22%7D%5D&clientProtocol=1.5',
  href:
   'https://firouzex.exphoenixtrade.com/realtime/negotiate?connectionData=%5B%7B%22name%22%3A%22getnewapitoken%22%7D%2C%7B%22name%22%3A%22omsclienthub%22%7D%5D&clientProtocol=1.5',
  headers: {} }

Upvotes: 0

Views: 270

Answers (1)

Garry
Garry

Reputation: 534

Known issue "client.Proxy settings currently only work for HTTP and not HTTPS". There is an another package for https https://www.npmjs.com/package/signalrjs. Copied it from npm package for signalr client not getting connected

Upvotes: 1

Related Questions