
Product
A New Overview in our Dashboard
We redesigned Socket's first logged-in page to display rich and insightful visualizations about your repositories protected against supply chain threats.
@codetheweb/recon
Advanced tools
Keep your network connections alive in node.js no matter what.
Recon looks like a regular tcp connection but it listens for disconnect events
and tries to re-establish the connection behind the scenes. While the connection
is down, write()
returns false
and the data gets buffered. When the
connection comes back up, recon emits a drain
event.
var recon = require('recon');
var conn = recon(ip, port);
conn.on('data', function (buf) {
var msg = buf.toString().trim()
console.log(msg);
});
Create a connection. The arguments can be specified in kwargs
or wherever in
arguments list and are optional except port.
retry
— Millisecond interval between reconnection retries.retryErrors
— An array of errors that will cause a reconnect. Default ['ECONNREFUSED']
.Like stream.write
, but buffers data while the module is reconnecting.
Terminate the connection (and don't reconnect).
Just like stream.
Emitted only the first time the connection is established.
Emitted each time the module establishes a connection after the first time.
Just like stream, unless err.code
is in the retryErrors
array, in which case the
error gets eaten and recon reconnects behind the scenes.
FAQs
Keep a network connection alive by reconnecting repeatedly
The npm package @codetheweb/recon receives a total of 3 weekly downloads. As such, @codetheweb/recon popularity was classified as not popular.
We found that @codetheweb/recon 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.
Product
We redesigned Socket's first logged-in page to display rich and insightful visualizations about your repositories protected against supply chain threats.
Product
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
Security News
CISA denies CVE funding issues amid backlash over a new CVE foundation formed by board members, raising concerns about transparency and program governance.