https://github.com/socketstream/ss-console
Adds a Console (REPL) interface to your SocketStream app
https://github.com/socketstream/ss-console
Last synced: 4 months ago
JSON representation
Adds a Console (REPL) interface to your SocketStream app
- Host: GitHub
- URL: https://github.com/socketstream/ss-console
- Owner: socketstream
- Created: 2012-02-23T17:05:45.000Z (about 14 years ago)
- Default Branch: master
- Last Pushed: 2015-07-14T15:32:02.000Z (almost 11 years ago)
- Last Synced: 2025-11-27T10:45:38.300Z (6 months ago)
- Language: JavaScript
- Homepage:
- Size: 148 KB
- Stars: 12
- Watchers: 6
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY.md
Awesome Lists containing this project
README
# Console (REPL) for SocketStream 0.3 apps
Allows you to connect to a running SocketStream server to call commands such as `ss.rpc()` or `ss.publish.all()` from the terminal. This can be very useful when debugging your app.
The SocketStream console follows the client/server model. This ensures the console client starts instantly and even allows you to run commands against a live production system, should you wish.
**Important Note** The latest release of ss-console (0.1.3) is designed to work with Node 0.8 only. If you are using Node 0.6 please install version 0.1.2 from npm.
### Installation
Add `ss-console` to your package.json then add the following lines to your `app.js` file:
```javascript
var consoleServer = require('ss-console')(ss);
consoleServer.listen(5000);
```
Change `5000` to another number if you wish to listen on another port.
### Connecting to a server
Install the client globally with:
$ sudo npm install -g ss-console
Once your server is listening out for incoming console connections, connect to it from the terminal by executing:
$ ss-console
By default `ss-console` will try to connect to a SocketStream server on localhost, port 5000. To connect to another host and/or port, pass params as so:
$ ss-console www.mysocketstreamserver.com 8500
Note: A new Session ID will be created for you each time you connect to the console, allowing you to call `ss.rpc()` commands which use the `req.use('session')` middleware.