So, I have a Python app that runs a uvicorn + FastAPI server. I don't want to expose it to a public network, I only need to use it internally. It's working fine. I also have a Go app that consumes info from this Python server. When I try to ping the server with this code:
func PingPythonServer(url string) error {
client := http.Client{
Timeout: 5 * time.Second,
}
url = "http://" + url
res, err := client.Get(fmt.Sprintf("%s/ping/", url))
if err != nil {
return err
}
if res.StatusCode != http.StatusOK {
return errors.New("GPT server is not ready")
}
return nil
}
url param is the Private Networking URL you automatically assigned. I tried adding "http://" prefix, removing it, adding :80 port, etc but it's not working unfortunately. I'm getting this error message:
Get \"http://gostock-python-sv.railway.internal/ping/\": dial tcp [fd12:1e3f:72a3::2c:a44e:2e7]:80: connect: connection refused
The server is working fine. If I expose it to the public network, I can access to it. If I remove the HTTP scheme, I get this error:
Get \"gostock-python-sv.railway.internal/ping/\": unsupported protocol scheme \"\"
Project ID: 7d9659a4-cd22-47d5-b1f7-ed6ce4247406
Any help on this, please?