From 1efe44745be86490fa83cba6d5037bf05c230510 Mon Sep 17 00:00:00 2001 From: gorogoroumaru Date: Sun, 30 Aug 2020 13:10:11 +0000 Subject: [PATCH 1/5] make columns configurable and customizable --- mitmproxy/tools/cmdline.py | 1 + mitmproxy/tools/web/static/app.css | Bin 15710 -> 15748 bytes mitmproxy/tools/web/static/app.js | Bin 185795 -> 187095 bytes mitmproxy/tools/web/webaddons.py | 6 +++++ web/src/css/flowtable.less | 3 +++ .../components/FlowTable/FlowRowSpec.js | 9 +++++-- .../components/FlowTable/FlowTableHeadSpec.js | 6 ++++- .../__snapshots__/FlowTableHeadSpec.js.snap | 6 +++++ .../js/components/FlowTable/FlowColumns.jsx | 20 ++++++++++++++- web/src/js/components/FlowTable/FlowRow.jsx | 16 +++++++++--- .../js/components/FlowTable/FlowTableHead.jsx | 23 +++++++++++++++--- 11 files changed, 79 insertions(+), 11 deletions(-) diff --git a/mitmproxy/tools/cmdline.py b/mitmproxy/tools/cmdline.py index a94f28206..b345a4ccf 100644 --- a/mitmproxy/tools/cmdline.py +++ b/mitmproxy/tools/cmdline.py @@ -137,6 +137,7 @@ def mitmweb(opts): opts.make_parser(group, "web_open_browser") opts.make_parser(group, "web_port", metavar="PORT") opts.make_parser(group, "web_host", metavar="HOST") + opts.make_parser(group, "web_columns") common_options(parser, opts) group = parser.add_argument_group( diff --git a/mitmproxy/tools/web/static/app.css b/mitmproxy/tools/web/static/app.css index bd69915bc6a38d811c51b45e977ada9a75215f22..70b37ea6ab8db6247bd63261c3c8496b2fabb651 100644 GIT binary patch delta 33 ocmcat)l$77R&uh9B&R@eNn&n6b$Mn=NrqKoX-WR(07*U-0Obh`fB*mh delta 12 TcmZpvzE`y&R&sN*B%=xdCm00s diff --git a/mitmproxy/tools/web/static/app.js b/mitmproxy/tools/web/static/app.js index f97d73054bf4b2f779e7e37f5ca5898aee04c39f..936f0519c546c2120cd08367979ef15548385b80 100644 GIT binary patch delta 1294 zcmcIjO=uHA6lS7DL_}<*trav`Yutr(OqB{IuGO|^(W;c>pe?aXb|+?Wva{~Yw$>6$ z5fLvvIEOt5ZNWcm3b6$7pq}*L(VHH;c=D(o1id-iv^APuJt^8IP$ns(s_V7BkiC^XkT^*xz0%2CM~Hz2$dlA z0}M3xQQ{Y!^QefKF-C1Gnh^21kE)KZyVT&@|{1C+F`MbPMN^Pk24x zD#$vi5rq?`=!$JpM;k}sWE=2yCa zFF}9c4ud_QD?qO!$AWJ+!Rd<);#I6ojv+7V86(-0omXoXGYkW39_GI1MC<7sTIG`p zYp4-R$SK6SbS~Z>-!VmGzt?>|lAb8$D1kP|9^%x?s#+?hQbQ#Mf)2jURZW8yb+DES zF>8!`gVY+5!q9e1;#-)hK6Io@AS1Sk zW+9X)StjJBoqZcQ+`=?o@aTAymr5%VJ<(EzheLBQxl{d^nak#4n5Si|^Yx8J3@Wna zwpOXSv8{a7QX9owxv8n%MY*j+)34$QX^l|Kvf;$=Vk@BH+G1vJ16Ct?_0?i;q*-rp wn}|*C3YIPcL!>H4ryBF@f4EVfTlLLl7lN6xOlkurVlTe|VvrVEE1e3LDsP>%sNv!SV80h5!mGn1pC6_@Wh0SA+4tH_hXtQ3<^;Te?>uNRk*0RbnMz&!y3lMlQGlQFIomr#!ZHh_nJvCh*;3tpET3 diff --git a/mitmproxy/tools/web/webaddons.py b/mitmproxy/tools/web/webaddons.py index 5e7d7982d..b792c5420 100644 --- a/mitmproxy/tools/web/webaddons.py +++ b/mitmproxy/tools/web/webaddons.py @@ -1,6 +1,8 @@ import webbrowser from mitmproxy import ctx +from typing import Sequence + class WebAddon: @@ -21,6 +23,10 @@ class WebAddon: "web_host", str, "127.0.0.1", "Web UI host." ) + loader.add_option( + "web_columns", Sequence[str], ["tls", "icon", "path", "method", "status", "size", "time"], + "Columns to show in the flow list" + ) def running(self): if hasattr(ctx.options, "web_open_browser") and ctx.options.web_open_browser: diff --git a/web/src/css/flowtable.less b/web/src/css/flowtable.less index e8d3d5afc..f7771dd3f 100644 --- a/web/src/css/flowtable.less +++ b/web/src/css/flowtable.less @@ -125,6 +125,9 @@ .col-time { width: 50px; } + .col-timestamp { + width: auto; + } td.col-time, td.col-size { text-align: right; } diff --git a/web/src/js/__tests__/components/FlowTable/FlowRowSpec.js b/web/src/js/__tests__/components/FlowTable/FlowRowSpec.js index 7dfc1dcd0..d8ef1d3e0 100644 --- a/web/src/js/__tests__/components/FlowTable/FlowRowSpec.js +++ b/web/src/js/__tests__/components/FlowTable/FlowRowSpec.js @@ -1,12 +1,17 @@ import React from 'react' import renderer from 'react-test-renderer' import FlowRow from '../../../components/FlowTable/FlowRow' -import { TFlow } from '../../ducks/tutils' +import { TFlow, TStore } from '../../ducks/tutils' +import { Provider } from 'react-redux' describe('FlowRow Component', () => { let tFlow = new TFlow(), selectFn = jest.fn(), - flowRow = renderer.create(), + store = TStore(), + flowRow = renderer.create( + + + ), tree = flowRow.toJSON() it('should render correctly', () => { diff --git a/web/src/js/__tests__/components/FlowTable/FlowTableHeadSpec.js b/web/src/js/__tests__/components/FlowTable/FlowTableHeadSpec.js index 3b7302f22..977425e3f 100644 --- a/web/src/js/__tests__/components/FlowTable/FlowTableHeadSpec.js +++ b/web/src/js/__tests__/components/FlowTable/FlowTableHeadSpec.js @@ -7,7 +7,11 @@ import { TStore } from '../../ducks/tutils' describe('FlowTableHead Component', () => { let sortFn = jest.fn(), - flowTableHead = renderer.create(), + store = TStore(), + flowTableHead = renderer.create( + + + ), tree =flowTableHead.toJSON() it('should render correctly', () => { diff --git a/web/src/js/__tests__/components/FlowTable/__snapshots__/FlowTableHeadSpec.js.snap b/web/src/js/__tests__/components/FlowTable/__snapshots__/FlowTableHeadSpec.js.snap index 3f066c6e9..46617efd4 100644 --- a/web/src/js/__tests__/components/FlowTable/__snapshots__/FlowTableHeadSpec.js.snap +++ b/web/src/js/__tests__/components/FlowTable/__snapshots__/FlowTableHeadSpec.js.snap @@ -79,6 +79,12 @@ exports[`FlowTableHead Component should render correctly 1`] = ` > Status + + TimeStamp + + {flow.request.timestamp_start ? ( + formatTimeStamp(flow.request.timestamp_start) + ) : ( + '...' + )} + + ) +} + +TimeStampColumn.headerClass = 'col-timestamp' +TimeStampColumn.headerName = 'TimeStamp' + export default [ TLSColumn, IconColumn, PathColumn, MethodColumn, StatusColumn, + TimeStampColumn, SizeColumn, TimeColumn, ] diff --git a/web/src/js/components/FlowTable/FlowRow.jsx b/web/src/js/components/FlowTable/FlowRow.jsx index 71a30e398..8325b41e7 100644 --- a/web/src/js/components/FlowTable/FlowRow.jsx +++ b/web/src/js/components/FlowTable/FlowRow.jsx @@ -1,8 +1,10 @@ import React from 'react' import PropTypes from 'prop-types' import classnames from 'classnames' -import columns from './FlowColumns' +import {defaultColumnNames} from './FlowColumns' import { pure } from '../../utils' +import {getDisplayColumns} from './FlowTableHead' +import { connect } from 'react-redux' FlowRow.propTypes = { onSelect: PropTypes.func.isRequired, @@ -11,7 +13,7 @@ FlowRow.propTypes = { selected: PropTypes.bool, } -function FlowRow({ flow, selected, highlighted, onSelect }) { +function FlowRow({ flow, selected, highlighted, onSelect, displayColumnNames }) { const className = classnames({ 'selected': selected, 'highlighted': highlighted, @@ -20,13 +22,19 @@ function FlowRow({ flow, selected, highlighted, onSelect }) { 'has-response': flow.response, }) + const displayColumns = getDisplayColumns(displayColumnNames) + return ( onSelect(flow.id)}> - {columns.map(Column => ( + {displayColumns.map(Column => ( ))} ) } -export default pure(FlowRow) +export default connect( + state => ({ + displayColumnNames: state.options["web_columns"] ? state.options["web_columns"].value : defaultColumnNames, + }) +)(pure(FlowRow)) diff --git a/web/src/js/components/FlowTable/FlowTableHead.jsx b/web/src/js/components/FlowTable/FlowTableHead.jsx index bbd8c9169..be1b3d771 100644 --- a/web/src/js/components/FlowTable/FlowTableHead.jsx +++ b/web/src/js/components/FlowTable/FlowTableHead.jsx @@ -2,7 +2,7 @@ import React from 'react' import PropTypes from 'prop-types' import { connect } from 'react-redux' import classnames from 'classnames' -import columns from './FlowColumns' +import columns, {defaultColumnNames} from './FlowColumns' import { setSort } from '../../ducks/flows' @@ -10,14 +10,30 @@ FlowTableHead.propTypes = { setSort: PropTypes.func.isRequired, sortDesc: PropTypes.bool.isRequired, sortColumn: PropTypes.string, + displayColumnNames: PropTypes.array, } -export function FlowTableHead({ sortColumn, sortDesc, setSort }) { +export function getDisplayColumns(displayColumnNames) { + let displayColumns = [] + if (typeof displayColumnNames == "undefined") { + return columns + } + for (const column of columns) { + if (displayColumnNames.includes(column.name.slice(0,-6).toLowerCase())) { + displayColumns.push(column) + } + } + return displayColumns +} + +export function FlowTableHead({ sortColumn, sortDesc, setSort, displayColumnNames}) { const sortType = sortDesc ? 'sort-desc' : 'sort-asc' + const displayColumns = getDisplayColumns(displayColumnNames) + return ( - {columns.map(Column => ( + {displayColumns.map(Column => ( setSort(Column.name, Column.name !== sortColumn ? false : !sortDesc)}> @@ -32,6 +48,7 @@ export default connect( state => ({ sortDesc: state.flows.sort.desc, sortColumn: state.flows.sort.column, + displayColumnNames: state.options["web_columns"] ? state.options["web_columns"].value : defaultColumnNames, }), { setSort From 54efe88a4538326870eee8e6a99048dc7a22a339 Mon Sep 17 00:00:00 2001 From: gorogoroumaru Date: Sun, 30 Aug 2020 13:33:01 +0000 Subject: [PATCH 2/5] fix linting issue --- mitmproxy/tools/web/webaddons.py | 1 - 1 file changed, 1 deletion(-) diff --git a/mitmproxy/tools/web/webaddons.py b/mitmproxy/tools/web/webaddons.py index b792c5420..99485dbc1 100644 --- a/mitmproxy/tools/web/webaddons.py +++ b/mitmproxy/tools/web/webaddons.py @@ -4,7 +4,6 @@ from mitmproxy import ctx from typing import Sequence - class WebAddon: def load(self, loader): loader.add_option( From 37672f0be0635911a1f746da4b96bd4bdddbfba9 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Tue, 30 Mar 2021 10:41:30 +0200 Subject: [PATCH 3/5] give gulp watch func a name --- web/gulpfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/gulpfile.js b/web/gulpfile.js index 53d4743db..e1f009bef 100644 --- a/web/gulpfile.js +++ b/web/gulpfile.js @@ -214,7 +214,7 @@ gulp.task( gulp.task("default", gulp.series( "dev", - function () { + function watch() { livereload.listen({auto: true}); gulp.watch(["src/css/vendor*"], gulp.series("styles-vendor-dev")); gulp.watch(["src/css/**"], gulp.series("styles-app-dev")); From 68c55979fbca4ca165b06ec85d6cd74bdd249d97 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Tue, 30 Mar 2021 11:16:55 +0200 Subject: [PATCH 4/5] update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 02a1518a7..be5e10a69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,7 @@ If you depend on these features, please raise your voice in events have been replaced with new events, see addon documentation for details (@mhils) * Contentviews now implement `render_priority` instead of `should_render`, allowing more specialization (@mhils) * Addition of block_list option to block requests with a set status code (@ericbeland) +* Make mitmweb columns configurable and customizable (@gorogoroumaru) * Automatic JSON view mode when `+json` suffix in content type (@kam800) * Use pyca/cryptography to generate certificates, not pyOpenSSL (@mhils) * Remove the legacy protocol stack (@Kriechi) From eefc55f28feab92c0d637ab8f11e339cce827c87 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Tue, 30 Mar 2021 12:12:38 +0200 Subject: [PATCH 5/5] coverage++ --- mitmproxy/test/tflow.py | 7 +- test/mitmproxy/tools/web/test_app.py | 16 +- web/README.md | 4 + .../components/FlowTable/FlowColumnsSpec.js | 8 + .../__snapshots__/FlowColumnsSpec.js.snap | 10 +- .../__snapshots__/FlowRowSpec.js.snap | 2 +- .../__snapshots__/DetailsSpec.js.snap | 250 +++++++++++++----- .../__snapshots__/MessagesSpec.js.snap | 100 +------ web/src/js/__tests__/ducks/_tflow.js | 44 ++- 9 files changed, 244 insertions(+), 197 deletions(-) diff --git a/mitmproxy/test/tflow.py b/mitmproxy/test/tflow.py index 9f76d34eb..496e380b5 100644 --- a/mitmproxy/test/tflow.py +++ b/mitmproxy/test/tflow.py @@ -184,9 +184,6 @@ def tserver_conn() -> connection.Server: return c -def terr(content="error"): - """ - @return: mitmproxy.proxy.protocol.primitives.Error - """ - err = flow.Error(content) +def terr(content: str = "error") -> flow.Error: + err = flow.Error(content, 946681207) return err diff --git a/test/mitmproxy/tools/web/test_app.py b/test/mitmproxy/tools/web/test_app.py index 8af0f85bb..79456e600 100644 --- a/test/mitmproxy/tools/web/test_app.py +++ b/test/mitmproxy/tools/web/test_app.py @@ -1,9 +1,9 @@ +import asyncio import json as _json import logging -from unittest import mock import os -import asyncio import sys +from unittest import mock import pytest @@ -331,14 +331,18 @@ class TestApp(tornado.testing.AsyncHTTPTestCase): # Set some value as constant, so that _tflow.js would not change every time. _tflow['client_conn']['id'] = "4a18d1a0-50a1-48dd-9aa6-d45d74282939" _tflow['id'] = "d91165be-ca1f-4612-88a9-c0f8696f3e29" - _tflow['error']['timestamp'] = 1495370312.4814785 - _tflow['response']['timestamp_end'] = 1495370312.4814625 - _tflow['response']['timestamp_start'] = 1495370312.481462 _tflow['server_conn']['id'] = "f087e7b2-6d0a-41a8-a8f0-e1a4761395f8" + _tflow["request"]["trailers"] = [["trailer", "qvalue"]] + _tflow["response"]["trailers"] = [["trailer", "qvalue"]] tflow_json = _json.dumps(_tflow, indent=4, sort_keys=True) here = os.path.abspath(os.path.dirname(__file__)) web_root = os.path.join(here, os.pardir, os.pardir, os.pardir, os.pardir, 'web') tflow_path = os.path.join(web_root, 'src/js/__tests__/ducks/_tflow.js') - content = f"""export default function(){{\n return {tflow_json}\n}}""" + content = ( + f"/** Auto-generated by test_app.py:TestApp._test_generate_tflow_js */\n" + f"export default function(){{\n" + f" return {tflow_json}\n" + f"}}" + ) with open(tflow_path, 'w', newline="\n") as f: f.write(content) diff --git a/web/README.md b/web/README.md index 7b412a5f1..1918583a8 100644 --- a/web/README.md +++ b/web/README.md @@ -7,6 +7,10 @@ and activate your virtualenv environment before proceeding.** - Run `yarn run gulp` to start live-compilation. - Run `mitmweb` and open http://localhost:8081/ +## Testing + +- Run `yarn run test` to run the testsuite. + ## Architecture There are two components: diff --git a/web/src/js/__tests__/components/FlowTable/FlowColumnsSpec.js b/web/src/js/__tests__/components/FlowTable/FlowColumnsSpec.js index 3622f3c1e..fdb69d12a 100644 --- a/web/src/js/__tests__/components/FlowTable/FlowColumnsSpec.js +++ b/web/src/js/__tests__/components/FlowTable/FlowColumnsSpec.js @@ -105,4 +105,12 @@ describe('FlowColumns Components', () => { tree = timeColumn.toJSON() expect(tree).toMatchSnapshot() }) + + it('should render TimeStampColumn', () => { + let timeStampColumn = renderer.create(), + tree = timeStampColumn.toJSON() + tflow.request.timestamp_start = + + expect(tree).toMatchSnapshot() + }) }) diff --git a/web/src/js/__tests__/components/FlowTable/__snapshots__/FlowColumnsSpec.js.snap b/web/src/js/__tests__/components/FlowTable/__snapshots__/FlowColumnsSpec.js.snap index 98ba8a109..f648ac98c 100644 --- a/web/src/js/__tests__/components/FlowTable/__snapshots__/FlowColumnsSpec.js.snap +++ b/web/src/js/__tests__/components/FlowTable/__snapshots__/FlowColumnsSpec.js.snap @@ -127,7 +127,7 @@ exports[`FlowColumns Components should render TimeColumn 1`] = ` - 415381h + 3s `; @@ -139,6 +139,14 @@ exports[`FlowColumns Components should render TimeColumn 2`] = ` `; +exports[`FlowColumns Components should render TimeStampColumn 1`] = ` + + 1999-12-31 23:00:00.000 + +`; + exports[`FlowColumns Components should render pathColumn 1`] = ` - 415381h + 3s `; diff --git a/web/src/js/__tests__/components/FlowView/__snapshots__/DetailsSpec.js.snap b/web/src/js/__tests__/components/FlowView/__snapshots__/DetailsSpec.js.snap index 418567758..388b56a24 100644 --- a/web/src/js/__tests__/components/FlowView/__snapshots__/DetailsSpec.js.snap +++ b/web/src/js/__tests__/components/FlowView/__snapshots__/DetailsSpec.js.snap @@ -155,6 +155,18 @@ exports[`Details Component should render correctly 1`] = ` TLSv1.2 + + + + ALPN: + + + + http/1.1 + + Resolved address: @@ -182,24 +194,20 @@ exports[`Details Component should render correctly 1`] = ` className="timing-table" > - - Server conn. initiated : - 1970-01-01 00:00:01.000 - - - - - Client conn. established - : - - - 1970-01-01 00:00:01.000 + 1999-12-31 23:00:02.000 + + ( + 2s + ) + @@ -208,25 +216,57 @@ exports[`Details Component should render correctly 1`] = ` : - 1970-01-01 00:00:02.000 + 1999-12-31 23:00:03.000 + + ( + 3s + ) + + + + + + + Client conn. established + : + + + 1999-12-31 23:00:00.000 + + ( + 0ms + ) + + + + + + + First request byte + : + + + 1999-12-31 23:00:00.000 - Client conn. SSL handshake + Request complete : - 1970-01-01 00:00:02.000 - - - - - Server conn. SSL handshake - : - - - 1970-01-01 00:00:03.000 + 1999-12-31 23:00:01.000 + + ( + 1s + ) + @@ -235,7 +275,14 @@ exports[`Details Component should render correctly 1`] = ` : - 2017-05-21 12:38:32.481 + 1999-12-31 23:00:02.000 + + ( + 2s + ) + @@ -244,7 +291,14 @@ exports[`Details Component should render correctly 1`] = ` : - 2017-05-21 12:38:32.481 + 1999-12-31 23:00:03.000 + + ( + 3s + ) + @@ -323,8 +377,6 @@ exports[`Details Component should render correctly when server address is missin className="timing-table" > - - @@ -334,16 +386,40 @@ exports[`Details Component should render correctly when server address is missin : - 1970-01-01 00:00:01.000 + 1999-12-31 23:00:00.000 + + ( + 0ms + ) + + + + + + + First request byte + : + + + 1999-12-31 23:00:00.000 - Client conn. SSL handshake + Request complete : - 1970-01-01 00:00:02.000 + 1999-12-31 23:00:01.000 + + ( + 1s + ) + @@ -352,7 +428,14 @@ exports[`Details Component should render correctly when server address is missin : - 2017-05-21 12:38:32.481 + 1999-12-31 23:00:02.000 + + ( + 2s + ) + @@ -361,7 +444,14 @@ exports[`Details Component should render correctly when server address is missin : - 2017-05-21 12:38:32.481 + 1999-12-31 23:00:03.000 + + ( + 3s + ) + @@ -400,24 +490,20 @@ exports[`Timing Component should render correctly 1`] = ` className="timing-table" > - - Server conn. initiated : - 1970-01-01 00:00:01.000 - - - - - Client conn. established - : - - - 1970-01-01 00:00:01.000 + 1999-12-31 23:00:02.000 + + ( + 2s + ) + @@ -426,25 +512,57 @@ exports[`Timing Component should render correctly 1`] = ` : - 1970-01-01 00:00:02.000 + 1999-12-31 23:00:03.000 + + ( + 3s + ) + + + + + + + Client conn. established + : + + + 1999-12-31 23:00:00.000 + + ( + 0ms + ) + + + + + + + First request byte + : + + + 1999-12-31 23:00:00.000 - Client conn. SSL handshake + Request complete : - 1970-01-01 00:00:02.000 - - - - - Server conn. SSL handshake - : - - - 1970-01-01 00:00:03.000 + 1999-12-31 23:00:01.000 + + ( + 1s + ) + @@ -453,7 +571,14 @@ exports[`Timing Component should render correctly 1`] = ` : - 2017-05-21 12:38:32.481 + 1999-12-31 23:00:02.000 + + ( + 2s + ) + @@ -462,7 +587,14 @@ exports[`Timing Component should render correctly 1`] = ` : - 2017-05-21 12:38:32.481 + 1999-12-31 23:00:03.000 + + ( + 3s + ) + diff --git a/web/src/js/__tests__/components/FlowView/__snapshots__/MessagesSpec.js.snap b/web/src/js/__tests__/components/FlowView/__snapshots__/MessagesSpec.js.snap index 387f868ab..b03d7f2bf 100644 --- a/web/src/js/__tests__/components/FlowView/__snapshots__/MessagesSpec.js.snap +++ b/web/src/js/__tests__/components/FlowView/__snapshots__/MessagesSpec.js.snap @@ -10,7 +10,7 @@ exports[`Error Component should render correctly 1`] = ` error
- 2017-05-21 12:38:32.481 + 1999-12-31 23:00:07.000
@@ -253,55 +253,6 @@ exports[`Request Component should render correctly 1`] = ` /> - - -
- - : - - - -
- - @@ -621,55 +572,6 @@ exports[`Response Component should render correctly 1`] = ` /> - - -
- - : - - - -
- - diff --git a/web/src/js/__tests__/ducks/_tflow.js b/web/src/js/__tests__/ducks/_tflow.js index cd5cf1460..27b294a8c 100644 --- a/web/src/js/__tests__/ducks/_tflow.js +++ b/web/src/js/__tests__/ducks/_tflow.js @@ -1,3 +1,4 @@ +/** Auto-generated by test_app.py:TestApp._test_generate_tflow_js */ export default function(){ return { "client_conn": { @@ -7,21 +8,21 @@ export default function(){ ], "alpn_proto_negotiated": "http/1.1", "cipher_name": "cipher", - "clientcert": null, "id": "4a18d1a0-50a1-48dd-9aa6-d45d74282939", "sni": "address", - "ssl_established": false, - "timestamp_end": 3.0, - "timestamp_ssl_setup": 2.0, - "timestamp_start": 1.0, + "timestamp_end": 946681206, + "timestamp_start": 946681200, + "timestamp_tls_setup": 946681201, + "tls_established": true, "tls_version": "TLSv1.2" }, "error": { "msg": "error", - "timestamp": 1495370312.4814785 + "timestamp": 946681207.0 }, "id": "d91165be-ca1f-4612-88a9-c0f8696f3e29", "intercepted": false, + "is_replay": null, "marked": false, "modified": false, "request": { @@ -45,16 +46,12 @@ export default function(){ "port": 22, "pretty_host": "address", "scheme": "http", - "timestamp_end": null, - "timestamp_start": null, + "timestamp_end": 946681201, + "timestamp_start": 946681200, "trailers": [ [ "trailer", "qvalue" - ], - [ - "content-length", - "7" ] ] }, @@ -75,16 +72,12 @@ export default function(){ "is_replay": false, "reason": "OK", "status_code": 200, - "timestamp_end": 1495370312.4814625, - "timestamp_start": 1495370312.481462, + "timestamp_end": 946681203, + "timestamp_start": 946681202, "trailers": [ [ "trailer", "qvalue" - ], - [ - "content-length", - "7" ] ] }, @@ -93,7 +86,7 @@ export default function(){ "address", 22 ], - "alpn_proto_negotiated": null, + "alpn_proto_negotiated": "http/1.1", "id": "f087e7b2-6d0a-41a8-a8f0-e1a4761395f8", "ip_address": [ "192.168.0.1", @@ -104,13 +97,12 @@ export default function(){ "address", 22 ], - "ssl_established": false, - "timestamp_end": 4.0, - "timestamp_ssl_setup": 3.0, - "timestamp_start": 1.0, - "timestamp_tcp_setup": 2.0, - "tls_version": "TLSv1.2", - "via": null + "timestamp_end": 946681205, + "timestamp_start": 946681202, + "timestamp_tcp_setup": 946681203, + "timestamp_tls_setup": 946681204, + "tls_established": true, + "tls_version": "TLSv1.2" }, "type": "http" }