Skip to content
This repository has been archived by the owner on Mar 16, 2022. It is now read-only.

Rocky not working on node@16 #123

Open
arminrosu opened this issue Jan 18, 2022 · 2 comments
Open

Rocky not working on node@16 #123

arminrosu opened this issue Jan 18, 2022 · 2 comments

Comments

@arminrosu
Copy link

Hello,

Not sure if this project is still maintained - but we were using it at and the upgrade to node@16 broke it.

const rocky = require('rocky')

const PORT = 8000
const URL = 'https://example.com'

const proxy = rocky()

proxy
  .forward(URL)
  .options({
    debug: true,
    forwardHost: true,
    ignorePath: true,
    secure: false,
    ws: true,
  })
  .on('proxyReq', function (_proxyReq, req, _res, opts) {
    console.log('Proxy request:', req.url, 'to', opts.target)
  })
  .on('proxyRes', function (_proxyRes, req, res) {
    // never gets here
    console.log('Proxy response:', req.url, 'with status', res.statusCode)
  })

proxy.routeAll()

proxy.listen(PORT)
console.log(`Server running on :${PORT}`)
node index.js

Any request results in an ERR_EMPTY_RESPONSE. Whereas on node <= 14 it works without a hitch.

Node versions affected:

  • 16.0.0
  • 16.13.1

Rocky Version:

  • 0.4.16

Working on node@14

Hope that helps others too.

@h2non
Copy link
Owner

h2non commented Jan 18, 2022

Hello! Rocky is not maintained anymore, I would recommend using http-proxy instead, or you might try forking and upgrading rocky dependencies, I suspect this has to do with http-proxy.

@arminrosu
Copy link
Author

@h2non thanks for the quick reply! We're moving to http-proxy / node-http-proxy.

It was odd that it was failing without any error, anywhere; this was odd.

Thanks for all your work on rocky!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants