ysbaddaden / prax

Rack proxy server for development
http://ysbaddaden.github.io/prax/
Other
475 stars 49 forks source link

Per-app port forwarding supported? #11

Closed suan closed 10 years ago

suan commented 11 years ago

Does prax support something like this?

(Pasted for convenience):

Pow's port proxying feature lets you route all web traffic on a particular hostname to another port on your computer. To use it, just create a file in ~/.pow (instead of a symlink) with the destination port number as its contents.

For example, to forward all traffic for http://proxiedapp.dev/ to port 8080:

$ echo 8080 > ~/.pow/proxiedapp

You can also use port proxying to access web apps written for other runtimes such as Python or Node.js. Remember that services behind the proxy won't automatically be started or stopped like Rack apps.

ysbaddaden commented 11 years ago

No.

I didn't know about that feature in pow before you pointed it to me. I'm wondering about use cases, but I don't see any (at least for my daily work).

suan commented 11 years ago

Yeah it's definitely more of an edge use case. In my case I have an app which serves different services via different ports.

gabpaladino commented 11 years ago

Hi @ysbaddaden is complex to implement this feature?

We have some apps working in apache, so with pow i can make a default app that redirects to port 8080 and all subdomain that is not ruby points to apache..

my team with linux can't do that! =/

ysbaddaden commented 11 years ago

I'm not exactly sure how it works internally in pow. So I'm not sure how to implement that feature and how it is.

I'd welcome a pull request :)

dyson commented 11 years ago

Working on a pull request for this.

gabpaladino commented 11 years ago

Good @dyson i tried work on it, whitout success

hsingh23 commented 11 years ago

@dyson How's that pull request coming?

ysbaddaden commented 10 years ago

I eventually found a need for port forwarding (having an app in a vagrant box) and added support for it in the unstable branch!

Switch to the unstable branch, then create a file with a port number inside in ~/.prax (instead of linking your app), and it should work.

prashantg-cuelogic commented 10 years ago

Facing same problem, anybody has any solution with prax for same

ysbaddaden commented 10 years ago

This is available in v0.1.0 now. Instead of linking your app, just create a file in ~/.prax with the port number inside (sams as Pow).

dyson commented 10 years ago

Glad this got implemented by someone else. I actually have written my own 'pow on linux' solution with a bit of a different take on things so never got around to implementing this. Prax is shaping up great!

ysbaddaden commented 10 years ago

Thanks! I'd love to see your "pow on linux", especially the different view points.

davidenglishmusic commented 9 years ago

@ysbaddaden Could you provide an example of the file and its contents that you would add to the ~/.prax directory so that the routing works for a app within a vagrant box?

ie. From within ~/.prax, I created a file entitled "myapp" with the content: 0.0.0.0 myapp.dev

ysbaddaden commented 9 years ago
$ echo 3000 > ~/.prax/myapp

This will proxy all traffic from myapp.dev to localhost:3000