Conditionally switch hostname when using `ionic serve` or `ionic cordova run android --livereload`

I have a Service that talks to a HTTP server. Because of CORS I use a CLI Service Proxy. Of course I then have to change the hostname the library is using from the external host to the proxy I defined.

Is there a way to automate this or choose the host conditionally so I don’t accidentally deploy, ionic upload or build with the “proxy host”?