https://github.com/dnafication/saz2js
A utility which consumes a saz file and converts it to a sessions object
https://github.com/dnafication/saz2js
Last synced: 5 months ago
JSON representation
A utility which consumes a saz file and converts it to a sessions object
- Host: GitHub
- URL: https://github.com/dnafication/saz2js
- Owner: dnafication
- License: mit
- Created: 2019-06-05T01:25:23.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-02-12T00:36:03.000Z (over 4 years ago)
- Last Synced: 2025-08-25T18:37:43.168Z (10 months ago)
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/saz2js
- Size: 48.8 KB
- Stars: 1
- Watchers: 0
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# saz2js
A utility to convert fiddler capture (`.saz`) to js object.
The code is inspired by [node-saz-parser](https://github.com/ludoviclefevre/node-saz-parser), updated to use [yauzl](https://github.com/thejoshwolfe/yauzl) instead of `unzip`.
**Breaking Change:** The release 1.0.0 and above allows you to control the content of sessions object, hence the api change. Now it parses the meta data as well.
## Usage
1. install the package `npm i saz2js`
2. sample node script
```javascript
const parser = require('saz2js');
const options = {
req: true, // determines if the sessions object will contain request data
res: true, // determines if the sessions object will contain response data
meta: true // determines if the sessions object will contain meta information
}
parser('test.saz', options, function(err, sessions) {
if (err) throw err;
console.log(sessions);
});
// sessions object
{
'09': {
request: {
method: 'GET',
url: 'https://example.com?refresh=Refresh&url=true',
protocol: 'HTTP/1.1',
headers: {
'Accepted': ''
...
},
content: 'body of request'
},
response: {
protocol: 'HTTP/1.1',
statusCode: '200',
status: 'OK',
headers: {
...
},
content: 'body of response'
},
meta: {
_declaration: {
_attributes: {
version: "1.0",
encoding: "utf-8"
}
},
Session: {
_attributes: {
SID: "167",
BitFlags: "19"
},
SessionTimers: {
_attributes: {
ClientConnected: "2019-06-07T11:24:55.8156275+10:00",
...
}
},
PipeInfo: {
_attributes: {
CltReuse: "true",
Reused: "true"
}
},
SessionFlags: {
SessionFlag: [
{
_attributes: {
N: "x-processinfo",
V: "chrome:6152"
}
},
...
]
}
}
}
}
}
...
};
```
That's it, really!