ultimatepos/websocket-server/README.md

41 lines
843 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# UltimatePOS WebSocket Server
سرور WebSocket محلی با پروتکل Pusher برای چت و اعلان‌های لحظه‌ای.
## راه‌اندازی
```bash
cd websocket-server
npm install
npm start
```
سرور روی `ws://127.0.0.1:6001` اجرا می‌شود.
## تنظیمات Laravel (`.env`)
```
BROADCAST_DRIVER=pusher
PUSHER_APP_ID=ultimatepos
PUSHER_APP_KEY=ultimatepos-key
PUSHER_APP_SECRET=ultimatepos-secret
PUSHER_HOST=127.0.0.1
PUSHER_PORT=6001
PUSHER_SCHEME=http
```
بعد از تغییر `.env`:
```bash
php artisan config:clear
```
## اجرا
1. ترمینال ۱: `php artisan serve`
2. ترمینال ۲: `cd websocket-server && npm start`
## نکته
اگر `npm start` خطا داد، نسخه Node.js را بررسی کنید (`node -v`). این سرور با Node 18+ کار می‌کند.