h2non/toxy

How to use timeout poison?

Opened this issue · 0 comments

I can't seem to get anywhere with the timeout poison:
`var toxy = require('toxy')
var poisons = toxy.poisons
var rules = toxy.rules

// Create a new toxy proxy
const proxy = toxy({
forwardHost: true,
})

// Default server to forward incoming traffic
proxy
.forward('http://httpbin.org')

proxy
.routeAll()

proxy
.all('/*')
.poison(poisons.timeout(5000))

proxy.listen(3000)
console.log('Server listening on port:', 3000)
`

The only result I ever get is "localhost didn’t send any data."