
Security News
Another Round of TEA Protocol Spam Floods npm, But It’s Not a Worm
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.
react-native-reconnecting-websocket
Advanced tools
React native auto reconnect websocket extends WebSocketModule. API design referenced reconnecting-websocket.
It is API compatible, so when you have:
var ws = new WebSocket('ws://....');
you can replace with:
var ws = new ReconnectingWebSocket('ws://....');
Less code, more exponential.
npm i react-native-reconnecting-websocket
var socket = new ReconnectingWebSocket(url, protocols, options);
urlprotocolsoptionsOptions can either be passed as the 3rd parameter upon instantiation or set directly on the object after instantiation:
var socket = new ReconnectingWebSocket(url, null, {reconnectInterval: 3000});
reconnectIntervalinteger1000maxReconnectIntervalinteger30000reconnectDecayinteger or float1.5timeoutIntervalinteger2000maxReconnectAttemptsinteger or null.nullSee the detail in react-native/WebSocket.js
ws = new WebSocket("ws://...");
ws.onopen = (e) => {
console.log("onopen",e)
};
ws.onmessage = (evt) => {
console.log("onmessage",JSON.parse(evt.data))
};
ws.onclose = (e) => {
console.log("onclose",e)
};
ws.onerror = (e) => {
console.log("onerror",e)
};
ws.onopen = (e) => {
// execute immediately!
ws.send("heartbeat string");
heartCheck.reset().start()
};
ws.onmessage = (evt) => {
heartCheck.reset().start()
};
var heartCheck = {
timeout: 10000,//default 10s
timeoutObj: null,
serverTimeoutObj: null,
reset:function(){
clearTimeout(this.timeoutObj);
clearTimeout(this.serverTimeoutObj);
return this;
},
start:function(){
let self = this;
this.timeoutObj = setTimeout(function(){
ws.send("heartbeat string");
self.serverTimeoutObj = setTimeout(function(){
ws.close();
}, self.timeout)
}, this.timeout)
}
}
FAQs
websocket module
We found that react-native-reconnecting-websocket demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.