Skip to content

Commit

Permalink
feat: CORE-8252 - pass args through sslsplit enable
Browse files Browse the repository at this point in the history
  • Loading branch information
Judy Lin committed Jul 11, 2024
1 parent 4a94468 commit d2e683c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions src/netmon.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,14 +229,20 @@ class NetworkMonitor {
}
}

/**
* @typedef {object} StartOptions
* @property {boolean} truncatePcap - Truncate PCAP file
*/

/** Start Network Monitor
* @param {StartOptions} options
* @example
* let netmon = await instance.newNetworkMonitor();
* netmon.start();
* netmon.start({ truncatePcap: true });
*/
async start () {
async start (options) {
await this.connect()
await this._fetch('/sslsplit/enable', { method: 'POST' })
await this._fetch('/sslsplit/enable', { method: 'POST' }, options)
await this.instance._waitFor(() => {
return this.instance.info.netmon && this.instance.info.netmon.enabled
})
Expand Down
2 changes: 1 addition & 1 deletion test/integration-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,7 @@ describe('Corellium API', function () {

it('can start monitor', async function () {
assert.strictEqual(
await netmon.start(),
await netmon.start({ truncatePcap: true }),
true,
'Expected the network monitor to start and return true'
)
Expand Down

0 comments on commit d2e683c

Please sign in to comment.