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.

[HowTo] Serve contents through a proxy

See original GitHub issue

Hello,

I am using haproxy with a lot of different rules in production and in development in order to serve static files and to hand over requests.

In my current setup, I first launch my WebpackDevServer on the port 9091, and then I launch my haproxy container which bind localhost:9091 to some custom URL like dev.lan on the port 80.

With react-app-cli, the project opens automatically a new tab with the WebpackDevServer URL. Is it possible to add something in this project like CUSTOM_URL which would allow me to set a custom HOST and to omit the PORT part?

Something like:

    if (process.env.CUSTOM_HOST_AND_PORT) {
      openBrowser(protocol + '://' + process.env.CUSTOM_HOST_AND_PORT + '/');
    }
    else {
      openBrowser(protocol + '://' + host + ':' + port + '/');
    }

This is a bit specific because I want to be able to dissociate the WebpackDevServer from the openBrowser URL opened?

Would you agree to integrate a pull request like that? Do you see another solution with the existing solution which does not involve to stop using my haproxy container?

This is a minor issue as I certainly can just open a new tab with the right URL (dev.lan) and everything is fine. But it looks a bit clumsy to have first to close the automatically opened tab.

Cheers,

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ekaradoncommented, Jan 12, 2017

Ok! Thank you for your quick feedback and this tool again! I will be waiting for the release of the 0.9 then.

0reactions
gaearoncommented, Jan 12, 2017

Oh, okay. To be honest this sounds a bit too esoteric for us to support this out of the box. With the support for custom BROWSER script (coming in 0.9.0) you can just point it to your own script that opens any URL you need.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is a Proxy Server? How They Work + List of Security Risks
A proxy server is an intermediary server that retrieves data from an Internet source, such as a webpage, on behalf of a user....
Read more >
Step by step guide on configuring your proxy settings
Locate the defaultProxy element and replace it with your proxy configuration created in the step 1 above, and then save your changes to...
Read more >
Proxy server: what is it, and do you need one? - Surfshark
A proxy server is an intermediary between the user and the internet. It makes internet requests on behalf of the user. But is...
Read more >
How To Set Up a Reverse Proxy (Step-By-Step for Nginx ...
Comprehensive Reverse Proxy guide for WordPress. Learn how to load a different WordPress site from a subdirectory via reverse proxy.
Read more >
How to serve all existing static files directly with NGINX, but ...
This would proxy /example to apache but allow /example.php to be downloaded. – Terence Johnson. Sep 9, 2015 at 13:16. 1.
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