now getting the correct IPV6 for proxy
This commit is contained in:
parent
7daa2e6cca
commit
a494cd4f0a
5 changed files with 18 additions and 4 deletions
|
|
@ -163,13 +163,21 @@ app.post("/deploy", async (req, res) => {
|
|||
const ipv6 = v6resp.data.data.allocateIpAddress.ipAddress.address;
|
||||
console.log("Allocated IPv6:", ipv6);
|
||||
|
||||
const machines = await fly.get(`/apps/${appName}/machines`);
|
||||
const firstPrivateIp = machines.data[0]?.private_ip;
|
||||
if (!firstPrivateIp) {
|
||||
console.error("No private IP found for the machine:", machines.data);
|
||||
return machines.status(500).json({ error: "No private IP found" });
|
||||
}
|
||||
console.log("First private IP:", firstPrivateIp);
|
||||
|
||||
return res.json({
|
||||
status: "created",
|
||||
app: appName,
|
||||
ipv4,
|
||||
ipv6,
|
||||
ipv6 : firstPrivateIp,
|
||||
url_v4: `http://${ipv4}`,
|
||||
url_v6: `http://[${ipv6}]`,
|
||||
url_v6: `http://[${firstPrivateIp}]`,
|
||||
});
|
||||
} catch (err) {
|
||||
console.error(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue