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.37b6cc16.chunk.js.map

1 line
29 KiB
Plaintext

{"version":3,"sources":["components/BreakPoint.js","flow.js","utils.js","message.js","App.js","reportWebVitals.js","index.js"],"names":["BreakPoint","props","state","show","rule","method","url","action","handleClose","bind","handleShow","handleSave","this","setState","rules","push","parseInt","onSave","Button","size","onClick","Modal","onHide","Header","closeButton","Title","Body","Form","Group","as","Row","Label","column","sm","Col","Control","value","onChange","e","target","Footer","variant","React","Component","FlowManager","items","_map","Map","filterText","filterTimer","num","max","filter","item","request","includes","no","set","id","length","oldest","shift","delete","get","text","callback","clearTimeout","setTimeout","isTextResponse","response","header","test","join","getSize","len","body","byteLength","isNaN","toFixed","messageEnum","allMessageBytes","Object","keys","map","k","messageByteMap","reduce","m","sendMessageEnum","App","flowMgr","flows","showList","flow","flowTab","ws","initWs","close","host","URL","document","WebSocket","binaryType","onopen","console","log","onclose","onmessage","evt","msg","data","meta","Int8Array","slice","type","TextDecoder","decode","waitIntercept","resp","content","JSON","parse","err","parseMessage","add","error","onerror","className","messageType","Error","bodyLen","headerBytes","TextEncoder","encode","stringify","ArrayBuffer","view","Uint8Array","view2","DataView","setUint32","buildMessageEdit","send","style","padding","statusCode","key","clear","placeholder","changeFilterLazy","rulesBytes","buildMessageMeta","Table","striped","bordered","f","u","path","pathname","search","classNames","renderFlow","reportWebVitals","onPerfEntry","Function","then","getCLS","getFID","getFCP","getLCP","getTTFB","ReactDOM","render","StrictMode","getElementById"],"mappings":"uRA4GeA,E,kDApGb,WAAYC,GAAQ,IAAD,8BACjB,cAAMA,IAEDC,MAAQ,CACXC,MAAM,EAENC,KAAM,CACJC,OAAQ,MACRC,IAAK,GACLC,OAAQ,MAIZ,EAAKC,YAAc,EAAKA,YAAYC,KAAjB,gBACnB,EAAKC,WAAa,EAAKA,WAAWD,KAAhB,gBAClB,EAAKE,WAAa,EAAKA,WAAWF,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EAAOA,EAAK5C,MAAM,EAAG,IAAM,OAEjD,IAAM3D,EAAUqG,EAAErG,QACZe,EAAWsF,EAAEtF,UAAY,GAEzB2F,EAAa,GAInB,OAHI,EAAK9J,MAAM2F,MAAQ,EAAK3F,MAAM2F,KAAKnC,KAAOiG,EAAEjG,IAAIsG,EAAWjJ,KAAK,eAChE4I,EAAEtC,eAAe2C,EAAWjJ,KAAK,qBAGnC,qBAAIgH,UAAWiC,EAAWrG,OAASqG,EAAWxF,KAAK,KAAO,KACxDpD,QAAS,WACP,EAAKP,SAAS,CAAEgF,KAAM8D,KAF1B,UAKE,6BAAKA,EAAEnG,KACP,6BAAK0C,IACL,6BAAK2D,IACL,6BAAKvG,EAAQjD,SACb,6BAAKgE,EAAS4E,YAAc,cAC5B,6BAAKxE,EAAQJ,OAVsDsF,EAAEjG,YAkBhF9C,KAAKqJ,oB,GAlQIvH,IAAMC,WCATuH,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,MAEFzE,SAAS0E,eAAe,SAM1BZ,M","file":"static/js/main.37b6cc16.chunk.js","sourcesContent":["import React from 'react'\nimport Button from 'react-bootstrap/Button'\nimport Modal from 'react-bootstrap/Modal'\nimport Form from 'react-bootstrap/Form'\nimport Row from 'react-bootstrap/Row'\nimport Col from 'react-bootstrap/Col'\n\nclass BreakPoint extends React.Component {\n constructor(props) {\n super(props)\n\n this.state = {\n show: false,\n\n rule: {\n method: 'ALL',\n url: '',\n action: '1',\n }\n }\n\n this.handleClose = this.handleClose.bind(this)\n this.handleShow = this.handleShow.bind(this)\n this.handleSave = this.handleSave.bind(this)\n }\n\n handleClose() {\n this.setState({ show: false })\n }\n\n handleShow() {\n this.setState({ show: true })\n }\n\n handleSave() {\n const { rule } = this.state\n const rules = []\n if (rule.url) {\n rules.push({\n method: rule.method === 'ALL' ? '' : rule.method,\n url: rule.url,\n action: parseInt(rule.action)\n })\n }\n\n this.props.onSave(rules)\n this.handleClose()\n }\n\n render() {\n const { rule } = this.state\n\n return (\n <div>\n <Button size=\"sm\" onClick={this.handleShow}>BreakPoint</Button>\n\n <Modal show={this.state.show} onHide={this.handleClose}>\n <Modal.Header closeButton>\n <Modal.Title>Set BreakPoint</Modal.Title>\n </Modal.Header>\n\n <Modal.Body>\n <Form>\n <Form.Group as={Row}>\n <Form.Label column sm={2}>Method</Form.Label>\n <Col sm={10}>\n <Form.Control as=\"select\" value={rule.method} onChange={e => { this.setState({ rule: { ...rule, method: e.target.value } }) }}>\n <option>ALL</option>\n <option>GET</option>\n <option>POST</option>\n <option>PUT</option>\n <option>DELETE</option>\n </Form.Control>\n </Col>\n </Form.Group>\n\n <Form.Group as={Row}>\n <Form.Label column sm={2}>URL</Form.Label>\n <Col sm={10}><Form.Control value={rule.url} onChange={e => { this.setState({ rule: { ...rule, url: e.target.value } }) }} /></Col>\n </Form.Group>\n\n <Form.Group as={Row}>\n <Form.Label column sm={2}>Action</Form.Label>\n <Col sm={10}>\n <Form.Control as=\"select\" value={rule.action} onChange={e => { this.setState({ rule: { ...rule, action: e.target.value } }) }}>\n <option value=\"1\">Request</option>\n <option value=\"2\">Response</option>\n <option value=\"3\">Both</option>\n </Form.Control>\n </Col>\n </Form.Group>\n </Form>\n </Modal.Body>\n\n <Modal.Footer>\n <Button variant=\"secondary\" onClick={this.handleClose}>\n Close\n </Button>\n <Button variant=\"primary\" onClick={this.handleSave}>\n Save Changes\n </Button>\n </Modal.Footer>\n </Modal>\n </div>\n )\n }\n}\n\nexport default BreakPoint\n","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","const messageEnum = {\n 'request': 1,\n 'requestBody': 2,\n 'response': 3,\n 'responseBody': 4,\n}\n\nconst allMessageBytes = Object.keys(messageEnum).map(k => messageEnum[k])\n\nconst messageByteMap = Object.keys(messageEnum).reduce((m, k) => {\n m[messageEnum[k]] = k\n return m\n}, {})\n\n\n// type: 1/2/3/4\n// messageFlow\n// version 1 byte + type 1 byte + id 36 byte + waitIntercept 1 byte + content left bytes\nexport const parseMessage = data => {\n if (data.byteLength < 39) return null\n const meta = new Int8Array(data.slice(0, 39))\n const version = meta[0]\n if (version !== 1) return null\n const type = meta[1]\n if (!allMessageBytes.includes(type)) return null\n const id = new TextDecoder().decode(data.slice(2, 38))\n const waitIntercept = meta[38] === 1\n\n const resp = {\n type: messageByteMap[type],\n id,\n waitIntercept,\n }\n if (data.byteLength === 39) return resp\n if (type === messageEnum['requestBody'] || type === messageEnum['responseBody']) {\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\nexport const sendMessageEnum = {\n 'changeRequest': 11,\n 'changeResponse': 12,\n 'changeBreakPointRules': 21,\n}\n\n// type: 11/12\n// messageEdit\n// version 1 byte + type 1 byte + id 36 byte + header len 4 byte + header content bytes + body len 4 byte + [body content bytes]\nexport const buildMessageEdit = (messageType, flow) => {\n let header, body\n \n if (messageType === sendMessageEnum.changeRequest) {\n ({ body, ...header } = flow.request)\n } else if (messageType === sendMessageEnum.changeResponse) {\n ({ body, ...header } = flow.response)\n } else {\n throw new Error('invalid message type')\n }\n \n const bodyLen = (body && body.byteLength) ? body.byteLength : 0\n const headerBytes = new TextEncoder().encode(JSON.stringify(header))\n const len = 2 + 36 + 4 + headerBytes.byteLength + 4 + bodyLen\n const data = new ArrayBuffer(len)\n const view = new Uint8Array(data)\n view[0] = 1\n view[1] = messageType\n view.set(new TextEncoder().encode(flow.id), 2)\n view.set(headerBytes, 2 + 36 + 4)\n if (bodyLen) view.set(body, 2 + 36 + 4 + headerBytes.byteLength + 4)\n\n const view2 = new DataView(data)\n view2.setUint32(2 + 36, headerBytes.byteLength)\n view2.setUint32(2 + 36 + 4 + headerBytes.byteLength, bodyLen)\n\n return view\n}\n\n\n// type: 21\n// messageMeta\n// version 1 byte + type 1 byte + content left bytes\nexport const buildMessageMeta = (messageType, rules) => {\n if (messageType !== sendMessageEnum.changeBreakPointRules) {\n throw new Error('invalid message type')\n }\n\n const rulesBytes = new TextEncoder().encode(JSON.stringify(rules))\n const view = new Uint8Array(2 + rulesBytes.byteLength)\n view[0] = 1\n view[1] = messageType\n view.set(rulesBytes, 2)\n\n return view\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 BreakPoint from './components/BreakPoint'\n\nimport { FlowManager } from './flow'\nimport { isTextResponse, getSize } from './utils'\nimport { parseMessage, sendMessageEnum, buildMessageEdit, buildMessageMeta } from './message'\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\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 === 'requestBody') {\n const flow = this.flowMgr.get(msg.id)\n if (!flow) return\n flow.waitIntercept = msg.waitIntercept\n flow.request.body = msg.content\n this.setState({ flows: this.state.flows })\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 = buildMessageEdit(sendMessageEnum.changeRequest, flow)\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 {\n !(response.header) ? null :\n <div className=\"header-block\">\n <p>Response Headers</p>\n <div className=\"header-block-content\">\n {\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\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\n {\n !(request.body && request.body.byteLength) ? null :\n <div className=\"header-block\">\n <p>Request Body</p>\n <div className=\"header-block-content\">\n <p>\n {\n !(isTextResponse(request)) ? \"Not text\" :\n new TextDecoder().decode(request.body)\n }\n </p>\n </div>\n </div>\n }\n\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 } = 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 <BreakPoint onSave={rules => {\n const msg = buildMessageMeta(sendMessageEnum.changeBreakPointRules, rules)\n this.ws.send(msg)\n }} />\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":""}