R
Railway12mo ago
linear

How to make request using private networking?

I have two services and want to make a call from service A to service B using private networking. When I try to make a request, I get the error:
Mixed Content: The page at '[...]' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint '[...]'. This request has been blocked; the content must be served over HTTPS
Mixed Content: The page at '[...]' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint '[...]'. This request has been blocked; the content must be served over HTTPS
I'm using http as specified in the docs here. My request looks like this:
let url4 = "http://[service-name].railway.internal:8080/api/home";
axios
.post(url4)
.then((res) => {
const r = res.data;
alert(r["message"]);
})
.catch((err) => {
alert(url4 + err);
});
let url4 = "http://[service-name].railway.internal:8080/api/home";
axios
.post(url4)
.then((res) => {
const r = res.data;
alert(r["message"]);
})
.catch((err) => {
alert(url4 + err);
});
The request works when I make it via public networking. Project ID: 1031bd42-29fd-490d-aa39-3bffdaef2fb1
Solution:
friendly little tip, when linked to an entire docs page and not a specific section please read the entire page, but these are the sections that answer your question directly. https://docs.railway.app/guides/private-networking#private-network-context and the first faq https://docs.railway.app/guides/private-networking#faq...
Jump to solution
12 Replies
Percy
Percy12mo ago
Project ID: 1031bd42-29fd-490d-aa39-3bffdaef2fb1
Brody
Brody12mo ago
this page and it's faq section should answer everything you would need to know https://docs.railway.app/guides/private-networking
linear
linearOP12mo ago
I have linked this page in my question and followed the exact steps to make a query there and the server does receive it but the http request is rejected because it's not https
Brody
Brody12mo ago
are you making the request from within the browser on the client side?
linear
linearOP12mo ago
I am making the request in nextjs via axios
Brody
Brody12mo ago
is the request made by the browser or by the backend
linear
linearOP12mo ago
I don't know but I assume it's the browser
Solution
Brody
Brody12mo ago
friendly little tip, when linked to an entire docs page and not a specific section please read the entire page, but these are the sections that answer your question directly. https://docs.railway.app/guides/private-networking#private-network-context and the first faq https://docs.railway.app/guides/private-networking#faq
linear
linearOP12mo ago
oh, I see That does make a lot of sense now Thank you so much! I will remember to read everything next time, sorry
Brody
Brody12mo ago
no worries, the docs are there to help you, and I'm here to fill in the gaps
linear
linearOP12mo ago
Thanks so much!!
Brody
Brody12mo ago
no problem!
Want results from more Discord servers?
Add your server