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

23 lines
547 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
var options = {
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
}
}
2021-03-24 05:59:19 +00:00
var request = http.get('http://test.target/', options, function (response) {
2020-11-09 09:14:25 +00:00
response.on('data', function (data) {
process.stdout.write(data)
})
})
request.on('error', function (error) {
console.log(error)
})