https://github.com/bramp/hessian.js
Node.js support for the Hessian binary web service protocol
https://github.com/bramp/hessian.js
Last synced: about 1 year ago
JSON representation
Node.js support for the Hessian binary web service protocol
- Host: GitHub
- URL: https://github.com/bramp/hessian.js
- Owner: bramp
- License: bsd-2-clause
- Created: 2012-11-29T03:15:40.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2013-05-02T02:12:47.000Z (about 13 years ago)
- Last Synced: 2025-06-20T23:03:29.058Z (about 1 year ago)
- Language: JavaScript
- Size: 148 KB
- Stars: 8
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Hessian.js
==========
This is an implementation of the Hessian protocol written in JavaScript for Node
by Andrew Brampton [http://bramp.net](bramp.net)
Copyright 2012-2013
Protocol reference:
-------------------
[http://hessian.caucho.com/doc/hessian-serialization.html](http://hessian.caucho.com/doc/hessian-serialization.html)
Intro
-----
Reading and writing hessian is supported
All valid hessian can be parsed, except for XML, Ref and Remote elements.
Install
-------
```bash
npm install hessian
```
Example
-------
Decoding
```javascript
var parser = new hessian.HessianParser();
parser.on('call', function(call, offset) {
// Will be called once for each call
});
parser.on('reply', function(reply, offset) {
// Will be called once for each reply
});
parser.on('object', function(obj, offset) {
// Will be called once for each object
});
parser.on('error', function(err) {
// Will only be called once on first error
});
// Now begin the parsing
parser.decode(buf);
```
Encoding
```javascript
var map = { 'map' : {key: value, key2: value2} };
var list = { 'list' : [1, 2, 3] [, type: 'int'] };
var string = "string";
var int = 123;
var bool = true;
var null = null;
var buf = hessian.encode(obj);
```
TODO
----
* Finish supporting all elements
* Add reply/fault support
* Find a good set of unit tests