h2non / rocky

Full-featured, middleware-oriented, programmatic HTTP and WebSocket proxy for node.js (deprecated)
MIT License
371 stars 24 forks source link

support wildcard replacement in toPath middleware #85

Closed zaggino closed 8 years ago

zaggino commented 8 years ago

I've wanted to impelement what tests say, but run into some weird issue. First request works fine, all the others don't. Seems not to be an issue of my implementation since modifying one of the original tests has the same behaviour.

zaggino commented 8 years ago

@h2non can you take a look what could be the problem here?

zaggino commented 8 years ago

Ok - I've fixed it, sorry for a bit of spamming :)

zaggino commented 8 years ago

With this I'm able to do:

proxy
  .get('/api/*')
  .forward('https://api.domain.com')
  .toPath('/*')
h2non commented 8 years ago

@zaggino I did some refactors. Take a look and let me know: https://github.com/h2non/rocky/commit/697887bb3512e5229c9303348bf8e51c6e845c15

h2non commented 8 years ago

This feature is now available in rocky@0.4.9. Feel free to update your dependency tree.

zaggino commented 8 years ago

Thanks for the quick merge :)

zaggino commented 8 years ago

I've updated to 0.4.10 and can confirm everything works fine now. Thanks

kevingilbert100 commented 6 years ago

This does not work with .routeAll()