| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 2a2fe8a commit 8c3b8e0
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,7 +6,7 @@ const net = require('net'); | |||
| 6 | 6 | const PORT = common.PORT; | |
| 7 | 7 | ||
| 8 | 8 | const bench = common.createBenchmark(main, { | |
| 9 | - len: [64, 102400, 1024 * 1024 * 16], | ||
| 9 | + len: [2, 64, 102400, 1024 * 1024 * 16], | ||
| 10 | 10 | type: ['utf', 'asc', 'buf'], | |
| 11 | 11 | dur: [5], | |
| 12 | 12 | }); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,8 +2,8 @@ | |||
| 2 | 2 | const common = require('../common.js'); | |
| 3 | 3 | const bench = common.createBenchmark(main, { | |
| 4 | 4 | dur: [5], | |
| 5 | - securing: ['SecurePair', 'TLSSocket'], | ||
| 6 | - size: [2, 1024, 1024 * 1024] | ||
| 5 | + securing: ['SecurePair', 'TLSSocket', 'clear'], | ||
| 6 | + size: [2, 100, 1024, 1024 * 1024] | ||
| 7 | 7 | }); | |
| 8 | 8 | ||
| 9 | 9 | const fixtures = require('../../test/common/fixtures'); | |
@@ -37,7 +37,8 @@ function main({ dur, size, securing }) { | |||
| 37 | 37 | isServer: false, | |
| 38 | 38 | rejectUnauthorized: false, | |
| 39 | 39 | }; | |
| 40 | - const conn = tls.connect(clientOptions, () => { | ||
| 40 | + const network = securing === 'clear' ? net : tls; | ||
| 41 | + const conn = network.connect(clientOptions, () => { | ||
| 41 | 42 | setTimeout(() => { | |
| 42 | 43 | const mbits = (received * 8) / (1024 * 1024); | |
| 43 | 44 | bench.end(mbits); | |
@@ -69,6 +70,9 @@ function main({ dur, size, securing }) { | |||
| 69 | 70 | case 'TLSSocket': | |
| 70 | 71 | secureTLSSocket(conn, client); | |
| 71 | 72 | break; | |
| 73 | + case 'clear': | ||
| 74 | + conn.pipe(client); | ||
| 75 | + break; | ||
| 72 | 76 | default: | |
| 73 | 77 | throw new Error('Invalid securing method'); | |
| 74 | 78 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments