dirkbonhomme / pusher-client-node Goto Github PK
View Code? Open in Web Editor NEWPusher client for node.js
License: MIT License
Pusher client for node.js
License: MIT License
I have a long-running instance of a pusher client. I'm trying to figure out how best to deal with dropped connections. In my logs I see things like this:
Error { type: 'WebSocketError',
error: 'Please reconnect immediately' }
I haven't been able to recreate that message in a debugging environment - but I can easily get connection errors by disabling my internet connection:
Error { type: 'WebSocketError',
error: 'Unknown socket error: ENOENT getaddrinfo' }
As far as I've been able to tell - there are no events or public functions for me to be able to monitor pusher error messages. Am I missing something?
Hello,
The reason I'm submitting this as an issue is that you want to maintain compatibility to the official pusher client, and pusher-client-node does not allow for setting a proxy. Since I work behind a corportate proxy, this has been a real headache, and I bet there are more people in the same situtation. I gave it a shot myself but I am not that knowledgeable.
Thanks in advance,
Pimeau
hello. here is what i did:
i have tried to mimic this webpage that use the pusher-client for webbrowser : https://www.bitstamp.net/s/examples/live_diff_order_book.html
var Pusher = require('pusher-client');
var pusher = new Pusher('de504dc5763aeef9ff52');
var bitstamp_orderbook_channel = pusher.subscribe('diff_order_book');
what i get { event: 'pusher:error', data: { code: 4004, message: 'Account over quota' } } trying connecting to pusher on - wss://ws.pusherapp.com:443/app/cb65d0a7a72cd94adf1f?client=node-pusher-server&version=0.0.1&protocol=5&flash=false
Hi.
I have something like this.
var socket = new Pusher('abc');
socket.disconnect();
But it's preventing Node from exiting. Is there a way to terminate?
Uncaught SyntaxError: Failed to construct 'WebSocket': The subprotocol '[object Object]' is invalid. Message is generated when I create a new Object of Pusher.
Code:
var pusher = new Pusher(API_KEY);
var channel = pusher.subscribe('test_channel');
channel.bind('my_event', function(data) {
alert(data.message);
});
Using the library pusher-client-node
gives some problems on a Raspberry Pi 3.
You can see after a while that the connection is lost on the Pusher dashboard. Nothing logs in the Raspberry terminal. After that, if you send a message via the PHP library, the Raspberry terminal will log a ws error 1006. Which means abnormal disconnection.
I tried the same script on my laptop at the same time with the Raspberry and it never loses the ws connection. I am using the same node version in both platforms.
I've been debuging for two days until I found it was a problem of the Raspberry.
What do you suggest I can do to help debug this?
Hello,
I am trying to keep the script running for a long period, but I am getting disconnections. The disconnection usually happens after 1-2 dyas. I followed the advices from the other issue related with the raspberry. Here is the trace I am getting:
Error { type: 'WebSocketError', error: 'close code 1006' }
{ type: 'WebSocketError', error: 'close code 1006' }
Error { type: 'WebSocketError',
error: 'Unknown socket error: ENOTFOUND getaddrinfo' }
{ type: 'WebSocketError',
error: 'Unknown socket error: ENOTFOUND getaddrinfo' }
Many thanks!
Hi,
I've recently seen that I hit the pusher error 1006:
Error { type: 'WebSocketError', error: 'close code 1006' }
I no longer seem to receive any messages after this event occurs so I took a look at the code and found that you've chosen not to handle this error with a retry:
https://github.com/dirkbonhomme/pusher-client-node/blob/master/lib/connection.js#L124
https://github.com/dirkbonhomme/pusher-client-node/blob/master/lib/connection.js#L128
I'm just wondering why this isn't included as part of the range you would like to retry on?
Also is there a way I can actively recover from such a disconnection?
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.