dev-sidecar/packages/mitmproxy/test/proxyTest.js

23 lines
535 B
JavaScript
Raw Normal View History

2021-03-24 05:59:19 +00:00
const http = require('http')
2020-11-09 09:14:25 +00:00
2024-04-02 04:35:39 +00:00
const options = {
2020-11-09 09:14:25 +00:00
headers: {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36',
2021-03-24 05:59:19 +00:00
},
lookup (hostname, options, callback) {
const ip = '106.52.191.148'
console.log('lookup')
callback(null, ip, 4)
},
2020-11-09 09:14:25 +00:00
}
const request = http.get('http://test.target/', options, (response) => {
response.on('data', (data) => {
2020-11-09 09:14:25 +00:00
process.stdout.write(data)
})
})
request.on('error', (error) => {
2020-11-09 09:14:25 +00:00
console.log(error)
})