test publish
Some checks failed
Deploy / deploy (push) Has been cancelled
Deploy / publish-web (push) Successful in 1m43s
Deploy / publish-tauri (push) Has been cancelled

This commit is contained in:
2025-12-22 19:23:06 +06:00
parent e3d0106d8f
commit 76f0ec74b5
27 changed files with 2123 additions and 1344 deletions

View File

@@ -1,6 +1,7 @@
import type { Socket } from 'socket.io-client'
import { createSharedComposable } from '@vueuse/core'
import { io } from 'socket.io-client'
import { parseURL } from 'ufo'
export const useSignaling = createSharedComposable(() => {
const toast = useToast()
@@ -58,16 +59,21 @@ export const useSignaling = createSharedComposable(() => {
})
function connect() {
if (socket.value)
if (socket.value || !me.value)
return
socket.value = io('https://api.koptilnya.xyz/webrtc', {
// socket.value = io('http://localhost:4000/webrtc', {
path: '/chad/ws',
const { protocol, host, pathname } = parseURL(__API_BASE_URL__)
const uri = host ? `${protocol}//${host}` : ``
socket.value = io(`http://localhost:4000/webrtc`, {
path: `/chad/ws`,
transports: ['websocket'],
// socket.value = io(`${uri}/webrtc`, {
// path: `${pathname}/ws`,
withCredentials: true,
auth: {
userId: me.value!.id,
userId: me.value.id,
},
})
}