{"content":"# aux4/queue\n\nIn-memory message queue with pub/sub support for aux4.\n\n## Installation\n\n``bash\naux4 aux4 pkger install aux4/queue\n`\n\n## Usage\n\n### Start the server\n\n`bash\naux4 queue start\naux4 queue start --port 9000 --token mysecret\n`\n\n### Create a queue\n\n`bash\naux4 queue create --name jobs\n`\n\n### Send messages\n\n`bash\necho '{\"task\":\"build\"}' | aux4 queue send --name jobs\ncat events.jsonl | aux4 queue send --name jobs\n`\n\n### Receive messages\n\n`bash\naux4 queue receive --name jobs\naux4 queue receive --name jobs --limit 10\naux4 queue receive --name jobs | jq .\n`\n\n### Stop the server\n\n`bash\naux4 queue stop\naux4 queue stop --port 9000\n`\n\n### List queues\n\n`bash\naux4 queue list\n`\n\n### Delete a queue\n\n`bash\naux4 queue delete --name jobs\n`\n\n## Proxy (WebSocket & Webhook)\n\nQueues can be configured to automatically forward every published message to a WebSocket or webhook endpoint. This enables real-time integration with external systems.\n\n### Create a queue with webhook proxy\n\nEvery message sent to this queue will also be POSTed to the webhook URL.\n\n`bash\naux4 queue create --name events --webhook https://api.example.com/ingest\n`\n\n### Create a queue with WebSocket proxy\n\nEvery message sent to this queue will also be written to the WebSocket connection.\n\n`bash\naux4 queue create --name logs --ws wss://stream.example.com/logs\n`\n\n### Custom headers\n\nAttach HTTP headers to proxy requests (applied to both WebSocket handshake and webhook POST).\n\n`bash\naux4 queue create --name secure-events \\\n --webhook https://api.example.com/ingest \\\n --header \"Authorization: Bearer tok123\"\n`\n\n### Pre-configured queues on startup\n\nUse --queues to create queues with proxy settings when the server starts.\n\n`bash\naux4 queue start --queues '[\n {\"name\": \"events\", \"webhook\": \"https://api.example.com/ingest\", \"header\": [\"Authorization: Bearer tok123\"]},\n {\"name\": \"logs\", \"ws\": \"wss://stream.example.com/logs\"}\n]'\n`\n\n## Authentication\n\nPass --token to start to require authentication. All clients must then include the same --token.\n\n`bash\naux4 queue start --token mysecret\naux4 queue create --name jobs --token mysecret\n``\n"}