Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge in "verbose" mode #31

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .npmignore

This file was deleted.

9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
# wscat
# wscatverbose

WebSocket cat. This is the same as https://github.com/websockets/wscat but this version displays flags of the messages which contain the buffer as well, sometimes handy for debugging

WebSocket cat.

## Installation

This module needs to be installed globally so use the `-g` flag when installing:

```
npm install -g wscat
npm install -g wscatverbose
```

## Usage

```
$ wscat -c ws://echo.websocket.org
$ wscatverbose -c ws://echo.websocket.org
connected (press CTRL+C to quit)
> hi there
< hi there
Expand Down
2 changes: 2 additions & 0 deletions bin/wscat → bin/wscatverbose
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ if (program.listen && program.connect) {
wsConsole.print('error: ' + code + (description ? ' ' + description : ''), Console.Colors.Yellow);
}).on('message', function message(data, flags) {
wsConsole.print('< ' + data, Console.Colors.Blue);
console.log(util.inspect(flags, false, null));
});
}).on('error', function servererrror(error) {
wsConsole.print('error: ' + error.toString(), Console.Colors.Yellow);
Expand Down Expand Up @@ -214,6 +215,7 @@ if (program.listen && program.connect) {
process.exit(-1);
}).on('message', function message(data, flags) {
wsConsole.print('< ' + data, Console.Colors.Blue);
console.log(util.inspect(flags, false, null));
});

wsConsole.on('close', function close() {
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"name": "wscat",
"name": "wscatverbose",
"version": "1.1.1",
"description": "WebSocket cat",
"description": "WebSocket cat verbose version",
"main": "index.js",
"scripts": {
"test": "echo \"No test specified\""
},
"repository": {
"type": "git",
"url": "https://github.com/websockets/wscat"
"url": "https://github.com/truhlikfredy/wscat"
},
"keywords": [
"wscat",
"wscatverbose",
"websocket",
"cat"
],
"author": "Arnout Kazemier, Einar Otto Stangvik",
"author": "Arnout Kazemier, Einar Otto Stangvik, verbose by Anton Krug",
"license": "MIT",
"dependencies": {
"commander": "~2.9.0",
Expand All @@ -24,6 +24,6 @@
"ws": "~1.1.1"
},
"bin": {
"wscat": "./bin/wscat"
"wscatverbose": "./bin/wscatverbose"
}
}