WebSocket & SocketIO auto-disconnects

Hello, While trying to use the StreamTip WebSocket when I connect the WS receives the connection but then nearly instantaneously disconnects without any errors; I am doing this with NodeJS and am dumbfounded of how its working. I tested the same library against the websocket echo server and it works fine.

// Connection [StreamTip][WebSocket Singularity]
var WebSocket = require(‘ws’);
var sTip = new WebSocket(‘wss://streamtip.com/ws?access_token=’ + encodeURIComponent("“myAccessToken”));

sTip.on(‘open’, function open() {
console.log("[STip] WebSocketSecure Opened!");

sTip.on('message', function(data, flags) {


sTip.on(‘close’, function close() {
console.log(’[STip] Connection Lost?’);

I have tries ws:// and wss://

The close event contains an error message. You should read what it says to determine why you’re being disconnected.

All it gave me was access defined; I retried with socket.io (I would prefer this over websocket) and now I receive the same error. but differently.

[Web] Server Online! Listening on Port:65
{ Error: xhr poll error
    at XHR.Transport.onError (C:\Users\Samuel\Desktop\WebTimer+\node_modules\eng
    at Request.<anonymous> (C:\Users\Samuel\Desktop\WebTimer+\node_modules\engin
    at Request.Emitter.emit (C:\Users\Samuel\Desktop\WebTimer+\node_modules\engi
    at Request.onError (C:\Users\Samuel\Desktop\WebTimer+\node_modules\engine.io
    at Timeout._onTimeout (C:\Users\Samuel\Desktop\WebTimer+\node_modules\engine
    at ontimeout (timers.js:365:14)
    at tryOnTimeout (timers.js:237:5)
    at Timer.listOnTimeout (timers.js:207:5) type: 'TransportError', description
: 400 }
401::Access Denied::
var Socket = require('socket.io-client');
global.streamTip = Socket.connect('https://streamtip.com', {
    query: 'access_token='+Config.streamTipAccessToken

streamTip.on('error', function(err) {

Then the access token you are using is invalid. If you are using the personal access token, you also need to pass client ID as described in the Authentication section of the documentation.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.