News from tauri
This commit is contained in:
@@ -2,46 +2,6 @@ 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;
|
||||
|
||||
@@ -64,7 +24,6 @@ export default defineConfig(async () => ({
|
||||
port: 1420,
|
||||
strictPort: true,
|
||||
host: host || false,
|
||||
proxy: newsProxy,
|
||||
hmr: host
|
||||
? {
|
||||
protocol: "ws",
|
||||
|
||||
Reference in New Issue
Block a user