Spaces:
Running
Running
File size: 558 Bytes
abed4cc b3ab3ba 3c0cf05 abed4cc 3c0cf05 b3ab3ba 3c0cf05 abed4cc 3c0cf05 abed4cc |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
const express = require('express');
const https = require('https');
const app = express();
app.get('/*', (req, res) => {
const url = 'https://platform.openai.com' + req.url;
https.get(url, (response) => {
response.pipe(res);
}).on('error', (err) => {
console.error(err);
res.status(500).send('Ошибка проксирования');
});
});
const port = 8080; // Выберите любой свободный порт
app.listen(port, () => {
console.log(`Прокси-сервер запущен на порту ${port}`);
}); |