Add multi-user server sync (PHP server + client)
Phase 2 implementation: Multiple streamers can now merge their captions into a single stream using a PHP server. PHP Server (server/php/): - server.php: API endpoint for sending/streaming transcriptions - display.php: Web page for viewing merged captions in OBS - config.php: Server configuration - .htaccess: Security settings - README.md: Comprehensive deployment guide Features: - Room-based isolation (multiple groups on same server) - Passphrase authentication per room - Real-time streaming via Server-Sent Events (SSE) - Different colors for each user - File-based storage (no database required) - Auto-cleanup of old rooms - Works on standard PHP hosting Client-Side: - client/server_sync.py: HTTP client for sending to PHP server - Settings dialog updated with server sync options - Config updated with server_sync section Server Configuration: - URL: Server endpoint (e.g., http://example.com/transcription/server.php) - Room: Unique room name for your group - Passphrase: Shared secret for authentication OBS Integration: Display URL format: http://example.com/transcription/display.php?room=ROOM&passphrase=PASS&fade=10×tamps=true NOTE: Main window integration pending (client sends transcriptions) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
42
server/php/config.php
Normal file
42
server/php/config.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* Multi-User Transcription Server - Configuration
|
||||
*
|
||||
* Simple PHP server for merging transcriptions from multiple clients
|
||||
*/
|
||||
|
||||
// Session configuration
|
||||
define('SESSION_LIFETIME', 3600); // 1 hour
|
||||
define('MAX_TRANSCRIPTIONS_PER_ROOM', 100);
|
||||
|
||||
// Storage directory (must be writable by PHP)
|
||||
define('STORAGE_DIR', __DIR__ . '/data');
|
||||
|
||||
// Enable CORS for cross-origin requests (if needed)
|
||||
define('ENABLE_CORS', true);
|
||||
|
||||
// Cleanup old sessions older than this (seconds)
|
||||
define('CLEANUP_THRESHOLD', 7200); // 2 hours
|
||||
|
||||
// Initialize storage directory
|
||||
if (!file_exists(STORAGE_DIR)) {
|
||||
mkdir(STORAGE_DIR, 0755, true);
|
||||
}
|
||||
|
||||
// Security headers
|
||||
header('X-Content-Type-Options: nosniff');
|
||||
header('X-Frame-Options: SAMEORIGIN');
|
||||
|
||||
// CORS headers (if enabled)
|
||||
if (ENABLE_CORS) {
|
||||
header('Access-Control-Allow-Origin: *');
|
||||
header('Access-Control-Allow-Methods: GET, POST, OPTIONS');
|
||||
header('Access-Control-Allow-Headers: Content-Type');
|
||||
}
|
||||
|
||||
// Handle preflight requests
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
|
||||
http_response_code(200);
|
||||
exit();
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user