1.7.1 • Published 10 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
10 years ago
1.7.0
10 years ago
1.6.1
10 years ago
1.6.0
10 years ago
1.5.0
10 years ago
1.4.3
10 years ago
1.4.2
10 years ago
1.4.1
10 years ago
1.4.0
10 years ago
1.3.1
10 years ago
1.2.2
10 years ago
1.2.1
10 years ago
1.2.0
10 years ago
1.1.3
10 years ago
1.1.2
10 years ago
1.1.1
10 years ago
1.1.0
10 years ago
1.0.4
10 years ago
1.0.3
10 years ago
1.0.2
10 years ago
1.0.1
10 years ago
1.0.0
10 years ago