Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added new option to change the server host #646

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

lukascaska
Copy link

@lukascaska lukascaska commented Oct 18, 2024

I am using this package to test my function and noticed something curious:
I wasn’t able to access my function from inside a Docker container. I was using http://host.docker.internal:3000 and it returned a "connection refused" error. I ran a test trying to access my frontend, which was also running locally (but with the host set to 0.0.0.0), and I was able to access it normally.

To work around the issue, I ran my container using "network_mode": "host" (in the docker-compose file), so everything was on the same network and it worked perfectly. However, to avoid this adjustment and make everything simpler, I decided to suggest this change.

  1. Run a function locally
  2. Create any Ubuntu container
  3. Execute inside the container and try to access your application using http://host.docker.internal:3000 (should return connection refused)
  4. As a test, try accessing any other server where you have the option to set 0.0.0.0

Reason:
Docker, by default, does not support IPv6 for the host.docker.internal network, which limits access to the host in environments that rely on this functionality.

Copy link

google-cla bot commented Oct 18, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link

@simoneb simoneb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, useful addition

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants