mirror of
https://github.com/cupcakearmy/cryptgeon.git
synced 2024-12-22 16:26:28 +00:00
add timeout
This commit is contained in:
parent
d7e5a34b14
commit
b05841a562
@ -10,7 +10,7 @@ proxy.on('error', function (err, req, res) {
|
|||||||
|
|
||||||
const server = http.createServer(function (req, res) {
|
const server = http.createServer(function (req, res) {
|
||||||
const target = req.url.startsWith('/api/') ? 'http://127.0.0.1:8000' : 'http://localhost:8001'
|
const target = req.url.startsWith('/api/') ? 'http://127.0.0.1:8000' : 'http://localhost:8001'
|
||||||
proxy.web(req, res, { target })
|
proxy.web(req, res, { target, proxyTimeout: 250, timeout: 250 })
|
||||||
})
|
})
|
||||||
server.listen(1234)
|
server.listen(1234)
|
||||||
console.log('Proxy on http://localhost:1234')
|
console.log('Proxy on http://localhost:1234')
|
||||||
|
Loading…
Reference in New Issue
Block a user