You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
go-mitmproxy/addon/web/client/build/static/js/main.597545a3.chunk.js.map

1 line
20 KiB
Plaintext

{"version":3,"sources":["flow.js","utils.js","App.js","reportWebVitals.js","index.js"],"names":["FlowManager","this","items","_map","Map","filterText","filterTimer","num","max","filter","item","request","url","includes","no","push","set","id","length","oldest","shift","delete","get","text","callback","clearTimeout","setTimeout","isTextResponse","response","header","test","join","getSize","len","parseInt","body","byteLength","isNaN","toFixed","buildMessage","messageType","content","TextEncoder","encode","data","Uint8Array","App","props","flowMgr","state","flows","showList","flow","flowTab","interceptUriInputing","interceptUri","ws","initWs","close","host","URL","document","WebSocket","binaryType","onopen","console","log","onclose","onmessage","evt","msg","meta","Int8Array","slice","type","TextDecoder","decode","resp","waitIntercept","JSON","parse","err","parseMessage","add","setState","error","onerror","className","onClick","Button","size","stringify","send","style","padding","method","statusCode","Object","keys","map","key","clear","Form","Control","placeholder","onChange","e","value","target","changeFilterLazy","display","alignItems","Table","striped","bordered","f","u","path","pathname","search","classNames","renderFlow","React","Component","reportWebVitals","onPerfEntry","Function","then","getCLS","getFID","getFCP","getLCP","getTTFB","ReactDOM","render","StrictMode","getElementById"],"mappings":"+NAAaA,G,MAAb,WACE,aAAe,oBACbC,KAAKC,MAAQ,GACbD,KAAKE,KAAO,IAAIC,IAChBH,KAAKI,WAAa,GAClBJ,KAAKK,YAAc,KACnBL,KAAKM,IAAM,EAEXN,KAAKO,IAAM,IARf,4CAWE,WAAY,IAAD,OACT,OAAKP,KAAKI,WACHJ,KAAKC,MAAMO,QAAO,SAAAC,GACvB,OAAOA,EAAKC,QAAQC,IAAIC,SAAS,EAAKR,eAFXJ,KAAKC,QAZtC,iBAkBE,SAAIQ,GAKF,GAJAA,EAAKI,KAAOb,KAAKM,IACjBN,KAAKC,MAAMa,KAAKL,GAChBT,KAAKE,KAAKa,IAAIN,EAAKO,GAAIP,GAEnBT,KAAKC,MAAMgB,OAASjB,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EzD,KACTA,EAAKzC,OAAS,KAAIyC,EAAOA,EAAKc,MAAM,EAAG,IAAM,OACjD,IAAI4C,EAAOD,EAAEE,SAAWF,EAAEG,OACtBF,EAAKnG,OAAS,KAAImG,EAAOA,EAAK5C,MAAM,EAAG,IAAM,OAEjD,IAAM9D,EAAUwG,EAAExG,QACZiB,EAAWuF,EAAEvF,UAAY,GAEzB4F,EAAa,GAInB,OAHI,EAAKvE,MAAMG,MAAQ,EAAKH,MAAMG,KAAKnC,KAAOkG,EAAElG,IAAIuG,EAAWzG,KAAK,eAChEoG,EAAErC,eAAe0C,EAAWzG,KAAK,qBAGnC,qBAAIwE,UAAWiC,EAAWtG,OAASsG,EAAWzF,KAAK,KAAO,KACxDyD,QAAS,WACP,EAAKJ,SAAS,CAAEhC,KAAM+D,KAF1B,UAKE,6BAAKA,EAAErG,KACP,6BAAK6C,IACL,6BAAK0D,IACL,6BAAK1G,EAAQoF,SACb,6BAAKnE,EAASoE,YAAc,cAC5B,6BAAKhE,EAAQJ,OAVsDuF,EAAElG,YAkBhFhB,KAAKwH,oB,GArPIC,IAAMC,WCGTC,EAZS,SAAAC,GAClBA,GAAeA,aAAuBC,UACxC,6BAAqBC,MAAK,YAAkD,IAA/CC,EAA8C,EAA9CA,OAAQC,EAAsC,EAAtCA,OAAQC,EAA8B,EAA9BA,OAAQC,EAAsB,EAAtBA,OAAQC,EAAc,EAAdA,QAC3DJ,EAAOH,GACPI,EAAOJ,GACPK,EAAOL,GACPM,EAAON,GACPO,EAAQP,OCDdQ,IAASC,OACP,cAAC,IAAMC,WAAP,UACE,cAAC,EAAD,MAEF1E,SAAS2E,eAAe,SAM1BZ,M","file":"static/js/main.597545a3.chunk.js","sourcesContent":["export class FlowManager {\n constructor() {\n this.items = []\n this._map = new Map()\n this.filterText = ''\n this.filterTimer = null\n this.num = 0\n\n this.max = 1000\n }\n\n showList() {\n if (!this.filterText) return this.items\n return this.items.filter(item => {\n return item.request.url.includes(this.filterText)\n })\n }\n\n add(item) {\n item.no = ++this.num\n this.items.push(item)\n this._map.set(item.id, item)\n \n if (this.items.length > this.max) {\n const oldest = this.items.shift()\n this._map.delete(oldest.id)\n }\n }\n\n get(id) {\n return this._map.get(id)\n }\n\n changeFilter(text) {\n this.filterText = text\n }\n\n changeFilterLazy(text, callback) {\n if (this.filterTimer) {\n clearTimeout(this.filterTimer)\n this.filterTimer = null\n }\n\n this.filterTimer = setTimeout(() => {\n this.filterText = text\n callback()\n }, 300)\n }\n\n clear() {\n this.items = []\n this._map = new Map()\n }\n}\n","export const isTextResponse = response => {\n if (!response) return false\n if (!response.header) return false\n if (!response.header['Content-Type']) return false\n\n return /text|javascript|json/.test(response.header['Content-Type'].join(''))\n}\n\nexport const getSize = response => {\n if (!response) return '0'\n if (!response.header) return '0'\n\n let len\n if (response.header['Content-Length']) {\n len = parseInt(response.header['Content-Length'][0])\n } else if (response && response.body) {\n len = response.body.byteLength\n }\n if (!len) return '0'\n if (isNaN(len)) return '0'\n if (len <= 0) return '0'\n \n if (len < 1024) return `${len} B`\n if (len < 1024*1024) return `${(len/1024).toFixed(2)} KB`\n return `${(len/(1024*1024)).toFixed(2)} MB`\n}\n\nexport const parseMessage = data => {\n if (data.byteLength < 39) return null\n const meta = new Int8Array(data.slice(0, 3))\n const version = meta[0]\n if (version !== 1) return null\n const type = meta[1]\n if (![1, 2, 3].includes(type)) return null\n const id = new TextDecoder().decode(data.slice(3, 39))\n\n const resp = {\n type: ['request', 'response', 'responseBody'][type-1],\n id,\n waitIntercept: meta[2] === 1,\n }\n if (data.byteLength === 39) return resp\n if (type === 3) {\n resp.content = data.slice(39)\n return resp\n }\n\n let content = new TextDecoder().decode(data.slice(39))\n try {\n content = JSON.parse(content)\n } catch (err) {\n return null\n }\n\n resp.content = content\n return resp\n}\n\n/**\n * \n * @param {number} messageType \n * @param {string} id \n * @param {string} content \n */\nexport const buildMessage = (messageType, id, content) => {\n content = new TextEncoder().encode(content)\n const data = new Uint8Array(39 + content.byteLength)\n data[0] = 1\n data[1] = messageType\n data[2] = 0\n data.set(new TextEncoder().encode(id), 3)\n data.set(content, 39)\n return data\n}\n","import React from 'react'\nimport Table from 'react-bootstrap/Table'\nimport Form from 'react-bootstrap/Form'\nimport Button from 'react-bootstrap/Button'\nimport './App.css'\n\nimport { FlowManager } from './flow'\nimport { isTextResponse, getSize, parseMessage, buildMessage } from './utils'\n\nclass App extends React.Component {\n\n constructor(props) {\n super(props)\n\n this.flowMgr = new FlowManager()\n\n this.state = {\n flows: this.flowMgr.showList(),\n flow: null,\n\n flowTab: 'Headers', // Headers, Preview, Response\n\n interceptUriInputing: '',\n interceptUri: '',\n }\n\n this.ws = null\n }\n\n componentDidMount() {\n this.initWs()\n }\n\n componentWillUnmount() {\n if (this.ws) {\n this.ws.close()\n }\n }\n\n initWs() {\n if (this.ws) return\n\n let host;\n if (process.env.NODE_ENV === 'development') {\n host = 'localhost:9081'\n } else {\n host = new URL(document.URL).host\n }\n this.ws = new WebSocket(`ws://${host}/echo`)\n this.ws.binaryType = 'arraybuffer'\n this.ws.onopen = () => { console.log('OPEN') }\n this.ws.onclose = () => { console.log('CLOSE') }\n this.ws.onmessage = evt => {\n const msg = parseMessage(evt.data)\n if (!msg) {\n console.error('parse error:', evt.data)\n return\n }\n // console.log('msg:', msg)\n\n if (msg.type === 'request') {\n const flow = { id: msg.id, request: msg.content, waitIntercept: msg.waitIntercept }\n this.flowMgr.add(flow)\n this.setState({ flows: this.flowMgr.showList() })\n }\n else if (msg.type === 'response') {\n const flow = this.flowMgr.get(msg.id)\n if (!flow) return\n flow.waitIntercept = msg.waitIntercept\n flow.response = msg.content\n this.setState({ flows: this.state.flows })\n }\n else if (msg.type === 'responseBody') {\n const flow = this.flowMgr.get(msg.id)\n if (!flow || !flow.response) return\n flow.waitIntercept = msg.waitIntercept\n flow.response.body = msg.content\n this.setState({ flows: this.state.flows })\n }\n }\n this.ws.onerror = evt => {\n console.log('ERROR:', evt)\n }\n }\n\n renderFlow() {\n const { flow, flowTab } = this.state\n if (!flow) return null\n\n const request = flow.request\n const response = flow.response || {}\n\n return (\n <div className=\"flow-detail\">\n <div className=\"header-tabs\">\n <span onClick={() => { this.setState({ flow: null }) }}>x</span>\n <span className={flowTab === 'Headers' ? 'selected' : null} onClick={() => { this.setState({ flowTab: 'Headers' }) }}>Headers</span>\n <span className={flowTab === 'Preview' ? 'selected' : null} onClick={() => { this.setState({ flowTab: 'Preview' }) }}>Preview</span>\n <span className={flowTab === 'Response' ? 'selected' : null} onClick={() => { this.setState({ flowTab: 'Response' }) }}>Response</span>\n {\n !flow.waitIntercept ? null :\n <div className=\"flow-wait-area\">\n <Button size=\"sm\" onClick={() => {\n const msg = buildMessage(11, flow.id, JSON.stringify(flow.request))\n this.ws.send(msg)\n flow.waitIntercept = false\n this.setState({ flows: this.state.flows })\n }}>Continue</Button>\n <Button size=\"sm\">Drop</Button>\n </div>\n }\n </div>\n\n <div style={{ padding: '20px' }}>\n {\n !(flowTab === 'Headers') ? null :\n <div>\n <div className=\"header-block\">\n <p>General</p>\n <div className=\"header-block-content\">\n <p>Request URL: {request.url}</p>\n <p>Request Method: {request.method}</p>\n <p>Status Code: {`${response.statusCode || '(pending)'}`}</p>\n </div>\n </div>\n\n <div className=\"header-block\">\n <p>Response Headers</p>\n <div className=\"header-block-content\">\n {\n !(response.header) ? null :\n Object.keys(response.header).map(key => {\n return (\n <p key={key}>{key}: {response.header[key].join(' ')}</p>\n )\n })\n }\n </div>\n </div>\n\n <div className=\"header-block\">\n <p>Request Headers</p>\n <div className=\"header-block-content\">\n {\n !(request.header) ? null :\n Object.keys(request.header).map(key => {\n return (\n <p key={key}>{key}: {request.header[key].join(' ')}</p>\n )\n })\n }\n </div>\n </div>\n </div>\n }\n\n {\n !(flowTab === 'Response') ? null :\n !(response.body && response.body.byteLength) ? <div>No response</div> :\n !(isTextResponse(response)) ? <div>Not text response</div> :\n <div>\n {new TextDecoder().decode(response.body)}\n </div>\n }\n </div>\n\n </div>\n )\n }\n \n render() {\n const { flows, interceptUriInputing, interceptUri } = this.state\n return (\n <div className=\"main-table-wrap\">\n <div className=\"top-control\">\n <div><Button size=\"sm\" onClick={() => {\n this.flowMgr.clear()\n this.setState({ flows: this.flowMgr.showList(), flow: null })\n }}>Clear</Button></div>\n <div>\n <Form.Control\n size=\"sm\" placeholder=\"Filter\"\n onChange={(e) => {\n const value = e.target.value\n this.flowMgr.changeFilterLazy(value, () => {\n this.setState({ flows: this.flowMgr.showList() })\n })\n }}\n >\n </Form.Control>\n </div>\n\n <div style={{ display: 'flex', alignItems: 'center' }}>\n <Form.Control size=\"sm\" placeholder=\"Set interpect\" value={interceptUriInputing} onChange={e => {\n this.setState({ interceptUriInputing: e.target.value || '' })\n }}></Form.Control>\n <Button size=\"sm\" onClick={() => {\n this.setState({ interceptUri: interceptUriInputing })\n const msg = buildMessage(21, '00000000-0000-0000-0000-000000000000', interceptUriInputing)\n this.ws.send(msg)\n }}>Set</Button>\n {\n interceptUri ? <span>{`Intercept:${interceptUri}`}</span> : null\n }\n </div>\n </div>\n\n <Table striped bordered size=\"sm\">\n <thead>\n <tr>\n <th>No</th>\n <th>Host</th>\n <th>Path</th>\n <th>Method</th>\n <th>Status</th>\n <th>Size</th>\n </tr>\n </thead>\n <tbody>\n {\n flows.map(f => {\n const url = f.request.url\n const u = new URL(url)\n let host = u.host\n if (host.length > 35) host = host.slice(0, 35) + '...'\n let path = u.pathname + u.search\n if (path.length > 65) path = path.slice(0, 65) + '...'\n\n const request = f.request\n const response = f.response || {}\n\n const classNames = []\n if (this.state.flow && this.state.flow.id === f.id) classNames.push('tr-selected')\n if (f.waitIntercept) classNames.push('tr-wait-intercept')\n\n return (\n <tr className={classNames.length ? classNames.join(' ') : null} key={f.id}\n onClick={() => {\n this.setState({ flow: f })\n }}\n >\n <td>{f.no}</td>\n <td>{host}</td>\n <td>{path}</td>\n <td>{request.method}</td>\n <td>{response.statusCode || '(pending)'}</td>\n <td>{getSize(response)}</td>\n </tr>\n )\n })\n }\n </tbody>\n </Table>\n\n {this.renderFlow()}\n </div>\n )\n }\n}\n\nexport default App\n","const reportWebVitals = onPerfEntry => {\n if (onPerfEntry && onPerfEntry instanceof Function) {\n import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\n getCLS(onPerfEntry)\n getFID(onPerfEntry)\n getFCP(onPerfEntry)\n getLCP(onPerfEntry)\n getTTFB(onPerfEntry)\n })\n }\n}\n\nexport default reportWebVitals\n","import React from 'react'\nimport ReactDOM from 'react-dom'\nimport 'bootstrap/dist/css/bootstrap.min.css'\nimport App from './App'\nimport reportWebVitals from './reportWebVitals'\n\nReactDOM.render(\n <React.StrictMode>\n <App />\n </React.StrictMode>,\n document.getElementById('root')\n)\n\n// If you want to start measuring performance in your app, pass a function\n// to log results (for example: reportWebVitals(console.log))\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\nreportWebVitals()\n"],"sourceRoot":""}