Working news

This commit is contained in:
2026-08-29 14:53:47 +02:00
parent 6032d5660c
commit c352862b46
2 changed files with 147 additions and 0 deletions
+41
View File
@@ -2,6 +2,46 @@ import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import tailwindcss from "@tailwindcss/vite";
import path from "path";
import type { ProxyOptions } from "vite";
const newsProxy: Record<string, ProxyOptions> = {
"/news/thn": {
target: "https://feeds.feedburner.com",
changeOrigin: true,
rewrite: (p) => p.replace(/^\/news\/thn/, "/TheHackersNews"),
headers: {
"User-Agent": "Mozilla/5.0",
},
},
"/news/krebs": {
target: "https://krebsonsecurity.com",
changeOrigin: true,
rewrite: (p) => p.replace(/^\/news\/krebs/, "/feed/"),
headers: {
"User-Agent": "Mozilla/5.0",
},
},
"/news/cisa": {
target: "https://www.cisa.gov",
changeOrigin: true,
rewrite: (p) =>
p.replace(/^\/news\/cisa/, "/cybersecurity-advisories/all.xml"),
headers: {
"User-Agent": "Mozilla/5.0",
},
},
"/news/bc": {
target: "https://www.bleepingcomputer.com",
changeOrigin: true,
rewrite: (p) => p.replace(/^\/news\/bc/, "/feed/"),
headers: {
"User-Agent":
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120 Safari/537.36",
Accept:
"application/rss+xml, application/xml;q=0.9, text/xml;q=0.8, */*;q=0.7",
},
},
};
const host = process.env.TAURI_DEV_HOST;
@@ -24,6 +64,7 @@ export default defineConfig(async () => ({
port: 1420,
strictPort: true,
host: host || false,
proxy: newsProxy,
hmr: host
? {
protocol: "ws",