FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
343 views 2 comments
by anonymous

Hi there,

I'm attempting to follow the instructions here to connect via websocket to the channels api. I'm using socket.io-client-v2.3.0 in a node js project, and am unable to get a response from the server.

My connection command looks like

const socket = io.connect('https://rms.teltonika-networks.com/status', {
transports: ['websocket'],
query: {token},
});

where token is my PAT token. I attach appropriate event listeners to the socket object.

I am not able to connect, the only thing that happens is a timeout:

socket.on('connect_error', (data: any) => {
console.log('connection error');
console.log(data);
});

Can you tell me if there is an issue with how I am setting up the websocket?

1 Answer

0 votes
by anonymous
Hello,

  

I'm not very familiar with node.js or socket.ai, thus I'd have to make a request for the developers to look into your code. This can take quite a bit of time.

However, I've tested and found that the HTTP Request method works fine, perhaps it could be used in your project? Or do you prefer to use node.js? In this case, we would have to wait for the developers to respond.

Awaiting your response!

  

Best regards,
DaumantasG
by anonymous
Hi,

yes, I've found that i can get channel updates via http request, that is working fine. So the websocket is a nice-to-have in our case, and this isn't an urgent ticket at all.

It would be good however to hear if there is something extra we need to do to get it working - as far as I can see I've simply followed the instructions in the api docs.

Thanks and regards,

Martin
by anonymous
Hello,

I'll try to figure out how to get the Socket.IO working and will update this query.

Best regards,
DaumantasG