1.7.1 • Published 8 years ago
minimal-http-proxy v1.7.1
minimal-http-proxy
Install
npm install
Usage
npm start [PORT]
const createProxyServer = require('minimal-http-proxy/server')
const proxyRequest = require('minimal-http-proxy')
// request, but trough a proxy
const proxyServer = createProxyServer(8888)
const req = proxyRequest({
// options that will be send to the proxy server
hostname: 'localhost',
port: 9090,
method: 'POST',
protocol: 'https', // make request over https (optional)
proxy: {
// all proxy specific options
protocol: 'https', // make request over https
hostname: 'localhost',
port: 8888,
method: 'POST'
}
}, (res) => {
var data = ''
res.on('data', (chunk) => {
data += chunk
})
res.on('end', () => {
console.log('succes!')
server.close()
proxyServer.close()
})
})
req.write('!')
req.end()
As a query parameter (basic)
proxy.url.com?proxy=http://google.com
As a query parameter with options
proxy.url.com?proxy={ "host": "google.com", "headers": { "lulz": tue } }
1.7.1
8 years ago
1.7.0
8 years ago
1.6.1
8 years ago
1.6.0
8 years ago
1.5.0
8 years ago
1.4.3
8 years ago
1.4.2
8 years ago
1.4.1
8 years ago
1.4.0
8 years ago
1.3.1
8 years ago
1.2.2
8 years ago
1.2.1
8 years ago
1.2.0
8 years ago
1.1.3
8 years ago
1.1.2
8 years ago
1.1.1
8 years ago
1.1.0
8 years ago
1.0.4
8 years ago
1.0.3
8 years ago
1.0.2
8 years ago
1.0.1
8 years ago
1.0.0
8 years ago