jecho is a client/server remote debugging tool written for Node.js, which aims to ease the (sad) life of the mobile web developer. It can be used with almost every browser, even desktop ones, but in those cases much more powerful debug tools already exist.
jecho.log() utility is provided to be used from within the web page, so that you can send
asynchronous messages to the server. The
jecho.log() obviously resembles the console.log() tool, but it isn't powerful that much: the serialization of objects is just a
JSON.stringify(obj, undefined, 2).
jecho support bidirectional communication thanks to WebSockets. The support is provided for the legacy and current WebSocket specifications (tested on iOS 4, 5, 6 and some versions of Android).
If for some reasons WebSockets are not supported, then you can still use the
jecho.log() thanks to XMLHttpRequest and CORS. In this case you'll not be able to send commands to the browser, but just receive the output from jecho.log.
The command line is handled by readline and the history is saved in ~/.jecho-history
I've it tested roughly in a lot of different environments, but mostly on WebKit based browser. It also works on Firefox and Opera Mini. Expect differences on how browsers handle the serialization of objects (like
If more than one client connects to the jecho server (you see the number reported in the console prompt), you'll be able to send commands only to the last one which "talked".
npm install jecho
or download everything and just run
Note for OSX brew users: npm is not installed along the installation of nodejs (a package manager won't install another package manager).
brew install npm and read the provided instructions.
Note for Ubuntu users: everything is fine, except for users of some old 11.x distribution (problems with... Python. Don't ask).
Run the jecho server with -h to read about a couple of options it accepts.
<script src="http://<jecho server ip address >/jecho.js"></script> <script> jecho.log("Hello from the jecho client!"); </script>
(The MIT License)
Copyright (c) 2012 Claudio Cicali email@example.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Claudio Cicali firstname.lastname@example.org
wcauchois who provided the nice wrapper for the WebSockets fallback