You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
first of all I would like to say that I really like working with Fuego. It is a nice experience so far.
However, I recently wanted to deploy my Fuego application to the Cloud (Google Cloud Run) and there are some problems with the default behavior imho.
The fuego.NewServer() function automatically calls the withPort() function, which itself sets the Addr field of the underlying http/server to localhost:port. Unfortunately, this has a side effect. When running the application inside a Docker container, you have to add the --net=host argument to make it accessible from the outside. This is different from the default bahavior of the http/server where the Addr field is just set to :port.
I would have expected that withPort only sets the port and not the host. In the end the only solution for Cloud Run was to use withAddr(":"+port). Then it can be accessed via the browser on localhost:8080, however the log says Server running ✅ on http://:8080, which is a bit confusing.
Therefore, I would suggest to make the behavior equal to the one in the standard library to avoid confusion when making a deployment.
That being said, I am still new to Go, so maybe there is a deeper reason I don´t know yet 😄)
Run the Docker container with the default bridge network
(optional) Run the Docker container in the cloud (e.g. on Google Cloud Run)
Try to access the application.
Expected behavior
Application is accessible without further configuration like when using the standard library http/server.
Framework version (please check if it happens with the last Fuego version before posting):
0.13 Go version (please check if it happens with the last Go version before posting):
1.22
The text was updated successfully, but these errors were encountered:
@EwenQuim not sure I understand? What seems to be the problem with WithAddr?
@oerni74 the fuego WithAddr function is essentially pass through behavior of setting .Server.Addr = "localhost:9090"
I'm pretty sure to get what you're after you can just WithAddr(":9090"). Also we stop using WithPort as our default recently in the New command so maybe try using fuego 0.13.4
Hi,
first of all I would like to say that I really like working with Fuego. It is a nice experience so far.
However, I recently wanted to deploy my Fuego application to the Cloud (Google Cloud Run) and there are some problems with the default behavior imho.
The
fuego.NewServer()
function automatically calls thewithPort()
function, which itself sets theAddr
field of the underlying http/server to localhost:port. Unfortunately, this has a side effect. When running the application inside a Docker container, you have to add the--net=host
argument to make it accessible from the outside. This is different from the default bahavior of thehttp/server
where theAddr
field is just set to :port.I would have expected that
withPort
only sets the port and not the host. In the end the only solution for Cloud Run was to usewithAddr(":"+port)
. Then it can be accessed via the browser on localhost:8080, however the log says Server running ✅ on http://:8080, which is a bit confusing.Therefore, I would suggest to make the behavior equal to the one in the standard library to avoid confusion when making a deployment.
That being said, I am still new to Go, so maybe there is a deeper reason I don´t know yet 😄)
To Reproduce
Steps to reproduce the behavior:
fuego.NewServer()
Expected behavior
Application is accessible without further configuration like when using the standard library
http/server
.Framework version (please check if it happens with the last Fuego version before posting):
0.13
Go version (please check if it happens with the last Go version before posting):
1.22
The text was updated successfully, but these errors were encountered: