powder-rb / powder

Makes Pow even easier. I mean really, really, ridiculously easy
http://git.io/powder
MIT License
1.29k stars 69 forks source link

Port forward in .powder file #110

Open farski opened 9 years ago

farski commented 9 years ago

Is there a way to make a .powder file that would set up a hostname to a specific port?

ckrailo commented 9 years ago

Hey @farski, I think this might be what you're looking for?

http://pow.cx/manual.html#section_2.1.4

Pow's port proxying feature lets you route all web traffic on a particular hostname to another port or IP address. 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 on your localhost: $ echo 8080 > ~/.pow/proxiedapp

To forward traffic for http://proxiedapp.dev/ to an IP address other than localhost (such as a virtual machine), create a file with the destination protocol, IP, and port: $ echo http://1.2.3.4: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.

farski commented 9 years ago

@ckrailo Yes, that's what I'm talking about. Does powder support that? Is there a way to write a .powder file such that when you run powder link it creates a file with a port number in it?

otagi commented 9 years ago

@farski You can use powder portmap PORT to create the proxy file instead of the symlink.

farski commented 9 years ago

@otagi I'm looking for a way to check the config into VC. We try to standardize powder link as part of a the setup process for each project we have, so ideally there would be a way to define the port map in a .powder file.