diff --git a/.npmignore b/.npmignore deleted file mode 100644 index 8d98f9d..0000000 --- a/.npmignore +++ /dev/null @@ -1 +0,0 @@ -.* diff --git a/README.md b/README.md index 5b87ead..8148697 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/bin/wscat b/bin/wscatverbose similarity index 98% rename from bin/wscat rename to bin/wscatverbose index 093ac56..e83149e 100755 --- a/bin/wscat +++ b/bin/wscatverbose @@ -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); @@ -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() { diff --git a/package.json b/package.json index 635b99a..0218a97 100644 --- a/package.json +++ b/package.json @@ -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", @@ -24,6 +24,6 @@ "ws": "~1.1.1" }, "bin": { - "wscat": "./bin/wscat" + "wscatverbose": "./bin/wscatverbose" } }