Skip to content

Commit

Permalink
Added a health check.
Browse files Browse the repository at this point in the history
This is so if you want to check the health using Render, you can just add /pfprxy/health.
  • Loading branch information
outment authored Feb 24, 2025
1 parent 2368599 commit c2a16be
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ proxy.on('error', (err, req, res) => {
})

const server = http.createServer((req, res) => {
if (req.url === '/pfprxy/health') {
res.writeHead(200, { 'Content-Type': 'text/plain' })
res.end('OK')
return
}
const targetUrl = 'http://147.185.221.25:33187'
const agent = createProxyAgent(req)
proxy.web(req, res, { target: targetUrl, agent })
Expand Down

0 comments on commit c2a16be

Please sign in to comment.