WebSocket Server Aktivan
Real-time komunikacija: poruke, typing, Watch Together, online status.
Server RADI
Port: 5578
Ručno pokretanje (preporučeno)
Pokrenite iz terminala za log monitoring:
Windows
cd socket
run.bat
run.bat
Linux
cd socket
bash run.sh
bash run.sh
Port
Napredna konfiguracija (systemd, SSL proxy)
Systemd Service
# /etc/systemd/system/noobot-ws.service
[Unit]
Description=NooBot WebSocket
After=network.target
[Service]
ExecStart=/usr/bin/php /var/www/html/chat/socket/server.php
WorkingDirectory=/var/www/html/chat
Restart=always
User=www-data
[Install]
WantedBy=multi-user.target
[Unit]
Description=NooBot WebSocket
After=network.target
[Service]
ExecStart=/usr/bin/php /var/www/html/chat/socket/server.php
WorkingDirectory=/var/www/html/chat
Restart=always
User=www-data
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable noobot-ws
sudo systemctl start noobot-ws
sudo systemctl enable noobot-ws
sudo systemctl start noobot-ws
Apache SSL Proxy (wss://)
sudo a2enmod proxy proxy_wstunnel rewrite
# VirtualHost:
RewriteEngine On
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteCond %{HTTP:Connection} upgrade [NC]
RewriteRule ^/ws$ ws://127.0.0.1:5578/ [P,L]
# VirtualHost:
RewriteEngine On
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteCond %{HTTP:Connection} upgrade [NC]
RewriteRule ^/ws$ ws://127.0.0.1:5578/ [P,L]