Connect to `/api/websocket` for real-time updates.
### WebSocket Messages
1. Server to Client:
- Ping messages: "ping"
- User updates: "!users:{user1,user2,user3}"
- Chat messages: "username: message"
2. Client to Server:
- Pong response: "pong"
- Message format: Same as HTTP send endpoint
## Setting up HTTPS with Caddy
Caddy provides automatic HTTPS and serves as a reverse proxy for your Chookpen server. [Download from caddyserver.com](https://caddyserver.com/download) or from your Linux/BSD/Illumos/Haiku/TempleOS/whatever distribution's package manager.
1. Create a `Caddyfile` in your server directory:
```
chat.yourdomain.com {
reverse_proxy localhost:7070
}
```
2. Start Caddy:
```bash
caddy run
```
Caddy will automatically obtain and manage SSL certificates for your domain.
## Client Deployment
Place your client files in the `src/main/resources/public` directory. The server will automatically serve these static files, making the client accessible at your server's root URL.
## Maintenance
### Database Files
-`userDatabase`: Contains user credentials in format `username:token:salt`
-`chatHistory`: Stores message history
- Regular backups recommended
### Health Checks
- Server automatically maintains WebSocket connections