fix webrtc and login
This commit is contained in:
@@ -1,8 +1,21 @@
|
||||
import {readFileSync} from 'node:fs'
|
||||
import {resolve} from 'node:path'
|
||||
import {fileURLToPath, URL} from 'node:url'
|
||||
import Vue from '@vitejs/plugin-vue'
|
||||
import Fonts from 'unplugin-fonts/vite'
|
||||
import {defineConfig} from 'vite'
|
||||
import Vuetify, {transformAssetUrls} from 'vite-plugin-vuetify'
|
||||
import {parse} from 'smol-toml'
|
||||
|
||||
const projectRoot = fileURLToPath(new URL('..', import.meta.url))
|
||||
const config = parse(readFileSync(resolve(projectRoot, 'config.toml'), 'utf8'))
|
||||
const network = config.network as {tcp_port: number, tls?: {cert_path: string, key_path: string}}
|
||||
const tls = network.tls
|
||||
const https = tls ? {
|
||||
cert: readFileSync(resolve(projectRoot, tls.cert_path)),
|
||||
key: readFileSync(resolve(projectRoot, tls.key_path)),
|
||||
} : undefined
|
||||
const target = `${tls ? 'https' : 'http'}://localhost:${network.tcp_port}`
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
@@ -47,15 +60,18 @@ export default defineConfig({
|
||||
server: {
|
||||
port: 3000,
|
||||
host: '0.0.0.0',
|
||||
https,
|
||||
allowedHosts: ["goesseau.eu"],
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://goesseau.eu:8080',
|
||||
target,
|
||||
changeOrigin: true,
|
||||
secure: !tls,
|
||||
},
|
||||
'/ws': {
|
||||
target: 'ws://goesseau.eu:8080',
|
||||
target,
|
||||
ws: true,
|
||||
secure: !tls,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user