Skip to content

Latest commit

 

History

History
31 lines (23 loc) · 475 Bytes

README.md

File metadata and controls

31 lines (23 loc) · 475 Bytes

reconnect-tls

Reconnect a tls/ssl stream when it goes down.

Installation

Via npm:

npm install reconnect-tls

Usage

var reconnect = require('reconnect-tls');

var options = {
	host: '127.0.0.1',
	post: 8000,
	key: fs.readFileSync('client-key.pem'),
	cert: fs.readFileSync('client-cert.pem')
};

reconnect(function(stream){
	stream.on('data', function(data){
		console.lod('data', data);
	});
}).connect(options);