question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow setting the proxy through an environment variable

See original GitHub issue

Is your proposal related to a problem?

We have multiple tenants and the tenant is specified as part of the url that we proxy to e.g. The bindings we use locally are of the form tenant1.localhost, tenant2.localhost Currently we manually change the value of the proxy setting in the package.json file depending on which tenant we’re testing against. This then means that that change often gets committed and leads to unnecessary conflicts as other devs have done the same.

Describe the solution you’d like

I suggest allowing the proxy setting to be controlled by either the package.json or an environment variable setting, with the environment variable winning if both are set. This would mean that a default value could be stored in the package.json, for the first time a dev environment is set up, but can be easily overridden without the possibilty for committing changes that lead to conflicts or affect other dev environments.

Describe alternatives you’ve considered

I tried configuring the proxy manually but we don’t have a simple set of rules that can be applied to determine if the request should be proxied, so I was unsuccessful, and the existing react scripts one works perfectly for our needs apart from this one issue.

Additional context

I think that the proxy setting is similar to other advanced configuration options set using environment variables in that they are often specific to development environments and so should be configurable in the same way.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:10
  • Comments:9

github_iconTop GitHub Comments

4reactions
brainwipecommented, Oct 2, 2020

Agreed! The proxy, like the host, port etc isn’t a concern of the package.json. It should live in environment variables.

2reactions
ChrisLanecommented, Jan 11, 2021

I just came looking to find if this feature exists already. Having to change the proxy in package.json, a VCS tracked file is not ideal for temporary adjustments that I don’t want to commit. Making changes in .env.development.local would be much preferred!

Hopefully the PR can be merged soon!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to set up proxy using http_proxy & https_proxy ...
Set up proxy server using http_proxy environment variable. The http_proxy and https_proxy environment variable is used to specify proxy settings to client ...
Read more >
Set http_proxy environment variable with domain user and ...
I've been trying to set http_proxy and https_proxy environment variables in windows using command prompt to be able to access my company's web ......
Read more >
How To Use Proxy Server To Access Internet at Shell Prompt ...
Linux and UNIX-like systems has environment variable called http_proxy. It allows you to connect text based session and/or applications via ...
Read more >
Configuring Proxy Settings for All Apps | Pivotal Docs
To globally configure proxy settings for Pivotal Platform apps, you must set three environment variables for both the staging environment ...
Read more >
What's the 'right' format for the HTTP_PROXY environment ...
This is because that variable can be injected by a client using the “Proxy:” HTTP header. If you need to use an HTTP...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found