typicode / hotel

🏩 A simple process manager for developers. Start apps from your browser and access them using local domains
MIT License
9.98k stars 424 forks source link

Proxy a site but also run a script #279

Open mehrdad-shokri opened 6 years ago

mehrdad-shokri commented 6 years ago

AFAIK hotel can be used to proxy urls or it can be used to run a script.
But is it possible to run a script (like npm start) and proxy site.localhost to localhost:4000?
I mean both run a script and proxy requests from a specific url at the same time.

typicode commented 6 years ago

Hmm, not sure if that's your question, but you can do

site$ hotel add 'npm start' --port 4000

Then if you visit site.localhost, hotel will run npm start and then proxy the request to localhost:4000

mehrdad-shokri commented 6 years ago

@typicode what about proxying to say 192.168.10.10 instead of localhost how can I handle that?

typicode commented 6 years ago

It's possible, but you can't have a script run at the same time then:

site$ hotel add http://192.168.10.10

Then when visiting site.localhost the request will be proxied to http://192.168.10.10

mehrdad-shokri commented 6 years ago

@typicode I was aware of proxying sites with hotel.
I was looking for a way to run say vagrant up and also proxy 192.168.10.10.
apparently this isn't possible