Generate proxies using fly machines

We have been at it for a week now, is it practical to start a vpn company based on fly machines?
The doc has helped a bit but i need a high level overview. We fire up a machine for each proxy but it doesn’t seem practical.

technically that seems like it would work alright? it wouldn’t be very efficient (a single large machine could handle a significant amount of VPN traffic from–probably–thousands of connections) but if your VPN profit exceeds your costs efficiency isn’t that big of a deal.

I would think the bigger issue would be one of IP denylisting. most streaming services–and many non-streaming services–block or otherwise limit traffic originating from public clouds. Fly might not be as aggressively blocked today as say AWS, but I expect that would change as Fly grows. dedicated IPs might be a way around this but someone from Fly would have to weigh in on how those are implemented

here is an abstraction from the code base:
const express = require(‘express’);
const fetch = require(‘node-fetch’);

const app = express();
const PORT = 8080;
const MACHINE_PORT = 5000;
const NUM_MACHINES = 10;
let machineIPs = ;

app.get(‘/list’, (req, res) => {
res.json({ machineIPs });
});

app.get(‘/refresh’, async (req, res) => {
try {
await destroyMachines();
await createMachines();
res.send(‘Machines refreshed’);
} catch (error) {
console.error(‘Error refreshing machines:’, error);
res.status(500).send(‘Error refreshing machines’);
}
});

app.listen(PORT, () => {
console.log(Server running on port ${PORT});
createMachines();
});

async function createMachines() {
for (let i = 0; i < NUM_MACHINES; i++) {
const response = await fetch(‘https://api.fly.io/api/v1/apps/:app_name/regions/:region_name/vms’, {
method: ‘POST’,
headers: {
‘Content-Type’: ‘application/json’,
// Add any required authentication headers
},
body: JSON.stringify({ PORT: MACHINE_PORT }),
});
const machineData = await response.json();
machineIPs.push(machineData.ip);
}
console.log(‘Machines created:’, machineIPs);
}

async function destroyMachines() {
// Add logic to destroy machines using the Fly.io API
machineIPs = ;
console.log(‘Machines destroyed’);
}

From How To to Questions / Help

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.