Comparing version 0.0.4 to 0.0.5
18
index.js
@@ -15,3 +15,4 @@ var ansi = require('ansi'); | ||
height: 40, | ||
port: 1337 | ||
port: 1337, | ||
localOnly: false | ||
}; | ||
@@ -33,2 +34,3 @@ | ||
this.opts.port = this.opts.port || defaultOpts.port; | ||
this.opts.localOnly = this.opts.localOnly || defaultOpts.localOnly; | ||
@@ -60,2 +62,11 @@ this.scrollX = 0; | ||
telnet.createServer(function(client) { | ||
var ip = client.input.remoteAddress; | ||
if (self.opts.localOnly && ip !== '127.0.0.1') { | ||
// disconnect the foreign client | ||
client.input.end(); | ||
client.output.end(); | ||
return; | ||
} | ||
self.connectedSock = client; | ||
@@ -95,3 +106,6 @@ | ||
console.log('monitor.io server started on '+ this.opts.port); | ||
console.log('monitor.io: server listening on '+ this.opts.port); | ||
if (this.opts.localOnly) { | ||
console.log('monitor.io: will only accept connections from 127.0.0.1'); | ||
} | ||
} else { | ||
@@ -98,0 +112,0 @@ // output to the current stdout |
{ | ||
"name": "monitor.io", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "description": "remote monitoring and debugging for socket.io", |
@@ -5,7 +5,7 @@ monitor.io | ||
![monitor.io](https://github.com/drewblaisdell/monitor.io/raw/master/monitor.io.gif "monitor.io") | ||
![monitor.io](https://i.imgur.com/O2XbYre.gif "monitor.io") | ||
`monitor.io` is a module for Node.js that runs as a telnet server, giving a remote client control of and information about sockets connected to an instance of `socket.io`. | ||
This makes it possible to disconnect, emit, or broadcast data to sockets in a remote terminal without interrupting the Node.js process running `socket.io`. `monitor.io`s also provides a real-time display of any data attached to a socket with the `socket#monitor` method. | ||
This makes it possible to disconnect, emit, or broadcast data to sockets in a remote terminal without interrupting the Node.js process running `socket.io`. `monitor.io` also provides a real-time display of any data attached to a socket with the `socket#monitor` method. | ||
@@ -37,2 +37,18 @@ Installation | ||
### Options | ||
#### localOnly | ||
Enable to prevent connections from any IP except `127.0.0.1`. Defaults to false. | ||
To run `monitor.io` safely in production, enable `localOnly` and access it via telnet via an ssh connection to your box. | ||
#### port | ||
The port number for the telnet server to listen on. | ||
#### remote | ||
Disable to run `monitor.io` in the current terminal window, without starting a telnet server. Defaults to true. | ||
### Monitoring | ||
@@ -68,4 +84,6 @@ | ||
`monitor.io` accepts an object | ||
License | ||
------- | ||
MIT |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18278
487
86