R
Railway6mo ago
128

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
Percy6mo ago
Project ID: 1031bd42-29fd-490d-aa39-3bffdaef2fb1
Brody
Brody6mo ago
this page and it's faq section should answer everything you would need to know https://docs.railway.app/guides/private-networking
128
1286mo 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
Brody6mo ago
are you making the request from within the browser on the client side?
128
1286mo ago
I am making the request in nextjs via axios
Brody
Brody6mo ago
is the request made by the browser or by the backend
128
1286mo ago
I don't know but I assume it's the browser
Solution
Brody
Brody6mo 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
128
1286mo 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
Brody6mo ago
no worries, the docs are there to help you, and I'm here to fill in the gaps
128
1286mo ago
Thanks so much!!
Brody
Brody6mo ago
no problem!
Want results from more Discord servers?
Add your server
More Posts
Force build using Nixpacks instead of DockerfileI have Dockerfile in my repo, but I don't want use it in production. I want Railway to build my projHelp Implementing Branch Previews for RailwayI am currently working on implementing neon branches via GitHub Actions whenever a new pull request project build error, it used to work well. Tunnel connection failed: 403 Forbiddeni have a simple project, https://railway.app/project/082a724b-8d54-43c3-92e9-d2b4c03acf57, i updateCan't remove cron job.https://cdn.discordapp.com/attachments/727689277219012669/1188368483583524864/CleanShot_2023-12-24_aDeploying Angular App - "Nixpacks build failed" ErrorHi! I am hoping someone can help me please. I am trying to deploy an Angular App. I have done this bupgrade to pro issuejust upgraded to pro plan, but getting this after i transferd my projectWriting files to a disk increases RAM usageI have a simple program that lets the user send the video. It downloads it and saves to the disk. NoRailway created a new team while I wanted to upgrade my other teamHi there, recently I tried to upgrade my team from the hobby plan to the pro plan to get access to tError: Cannot find module './pnpm.cjs' when trying to build an Nx monorepo appI might just be off the beaten track here with pnpm, as this looks like a build system error rather DockerFile fails to install packages with yarn install and doesn't generate node_modulesThis is my DockerFile ```# Build stage FROM node:18 as builder WORKDIR /app COPY package.json . COPY