
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
react-native-websocket-messaging
Advanced tools
Wrapper for react native websocket communication
Wrapper for react native websocket communication
npm install react-native-websocket-messaging --save
- or -
yarn add react-native-websocket-messaging
import React from 'react';
import WSMessaging from 'react-native-websocket-messaging';
export default class Example extends React.Component
{
constructor()
{
this.connection = new Connection( this, [ { host: 'wss://127.0.0.1', port: 21 } ] );
}
componentDidMount()
{
this.connection.send( 'hello',
{
data : {}
},
( status, data ) =>
{
if( status === 'NETWORKING' )
{
switch( data )
{
case 'SENT' : console.log( 'message:sent' ); break;
case 'RECEIVED' : console.log( 'message:received' ); break;
case 'REPLIED' : console.log( 'message:replied' ); break;
case 'TIMEOUT' : console.log( 'message:timeout' ); break;
}
}
}, 10000 )
.then( async ( message ) =>
{
//YOUR LOGIC HERE
return message.reply({ ok: true }, 5000);
})
.then( async ( message ) =>
{
//YOUR LOGIC HERE, SECOND MESSAGE REPLY
})
.catch(( e ) =>
{
//Error handling here ( timeot, ... )
});
}
async on_pair_message( message )
{
//HANDLING YOR MESSAGE FROM SERVER
}
}
Easily changing ip & port Example:
import WSMessaging from 'react-native-websocket-messaging';
export default class Example extends React.Component
{
componentWillUnmount()
{
this.connection.changeServers( [ { host: 'wss://127.0.0.1', port: 21 } ] );
}
}
Detection of connect status Example:
import WSMessaging from 'react-native-websocket-messaging';
export default class Example extends React.Component
{
componentWillUnmount()
{
this.connection.connected;
}
}
Destroy connection Example:
import WSMessaging from 'react-native-websocket-messaging';
export default class Example extends React.Component
{
componentWillUnmount()
{
this.connection.destroy();
}
}
FAQs
Wrapper for react native websocket communication
The npm package react-native-websocket-messaging receives a total of 0 weekly downloads. As such, react-native-websocket-messaging popularity was classified as not popular.
We found that react-native-websocket-messaging demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.