eclipse-agail / agile-sdk

JavaScript Agile IoT SDK
Eclipse Public License 2.0
2 stars 4 forks source link

websocket protocol always uses 1338 port instead of configuraton #28

Closed dpap closed 6 years ago

dpap commented 6 years ago

When using websockets agile-sdk doesn't use right port. Instead of using the port in api it uses the default value.

var agile = require('./dist/index.js')({
  api: 'http://localhost:8080' //,
//  idm: 'http://localhost:3000',
//  token: "LQCL7C14y84Ayqedjmbm1LuIes1TsSyn5Cv"
})
const deviceId = 'ble84EB1866ECE3';
const componentID = 'PULSE';

wsbug

craigmulligan commented 6 years ago

Thanks for reporting, looks like we are mutating the parsed url.

https://github.com/Agile-IoT/agile-sdk/blob/master/src/index.js#L34-L36

Will PR a fix soon.

craigmulligan commented 6 years ago

Fixed with v1.1.0