typicode / hotel

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

Add exceptions for Top Level Domains (TLD) #351

Open fraserc12 opened 4 years ago

fraserc12 commented 4 years ago

This is my config file:

{
  "port": 2000,
  "host": "127.0.0.1",
  "timeout": 5000,
  "tld": "dev.appname.org",
  "proxy": false
}

This work great as we deploy a couple applications locally and access using https://local.dev.appname.org for example

Problem: We have an application deployed on a remote server we access that has the domain https://sandbox.dev.appname.org

Which will obviously try route through Hotel when we try to access it locally and causes a server not defined error

Question: Is there a way to add an exclusion to the tld configuration? So that we can keep our current set up and still have Hotel running?

Thanks

j-f1 commented 4 years ago

If you know the IP address for that server, you could set up a proxy from sandbox to that IP address.

fraserc12 commented 4 years ago

@j-f1 What would be ideal, for us, is to have an extra attibute in the conf.json, something like "excludeFromTLD" - which would be a list in our case.

And then make a change in the src/daemon/views/proxy-pac.pug file to use that value as a conditon (when comparing the host and '.#{conf.tld}') and return 'REDIRECT' rather than 'PROXY 127.0.0.1:#{conf.port}'

Would that be something you would consider looking at if I submitted a PR?

Apologies for delay in replying, this recently came up again within our development team as an issue.

j-f1 commented 4 years ago

I’m not actually a maintainer of this repo, so I think you’d be better off forking hotel for yourself and making the changes you need.