Interesting. I got it reading and writing over https and websockets, now, but the stream opens and then immediately closes.
This is a browser app, but will run on the phone as a PWA and the desktop as an Electron app or similar, so wanted to live-stream a text feed on the landing page (so that it looks alive and everyone can see that the relay feed is active) and live-notifications and etc. Idea is that, if they install Realy they get that over the more-efficient SSE, and it defaults to websockets, otherwise. I pause websocket-streaming, in low-bandwidth, but keep the sse open, if there's enough network to keep it moving.
Thread
Login to reply
Replies (2)
This is the choice of backend installers+integration we've decided to offer:
**Backend**
- A Realy installation offers an expanded feature set, such as:
- a full RESTful API that covers all the core Nostr protocol
- SSE streaming over HTTP
- elegant handling in low-bandwidth networks
- maximizing your ability to integrate with other apps, hardware, and protocols
- GRAIN comes along with an advanced document database (MongoDB)
- StrFry is a very mature, performant relay
- Nostr-relay-tray is a lightweight, popular personal relay
- Nostr DB is a fast storage, for those who don't want a full relay integrated.
This is what my test delivers, so far. The SSE is alive and responding, but it closes quickly.
🚀 Testing Realy Relay Complete Interface Suite
📍 Target: localhost:3334
🔑 Authentication: Available
🔍 Testing HTTP REST Interface...
✅ Event count endpoint working
📊 Event count: 101
✅ Event IDs endpoint working
📊 Event IDs response: [{"s":1000,"i":"2c765e27f763d9dd5934cca0d215f84207a88228e14dad59cca75788250b103f"},{"s":1001,"i":"73...
🔍 Testing WebSocket Interface...
✅ WebSocket connected
📤 Sending REQ: ["REQ","test1",{"kinds":[1],"limit":10}]
⏰ WebSocket test timeout - but connection was established
🔊 Streaming SSE and publishing events using worker threads...
📤 Will publish 5 events during the stream...
✅ Generated NIP-98 authentication token
✅ WebSocket connection closed normally
✅ Decoded nsec1 format to hex
✅ Published pre-SSE event #1: 42cbc57414ec7b4e...
✅ Published pre-SSE event #2: 32d18392ca0b05be...
✅ SSE connection established, status: 200
🔚 SSE stream ended. Total events received: 0
📝 Creating event #1...
✅ Published event #1: fe8aaebcb4fa9368...
📝 Creating event #2...
✅ Published event #2: 12e3e27aadafcf17...
📝 Creating event #3...
✅ Published event #3: 05b42acb60157cc1...
📝 Creating event #4...
✅ Published event #4: 55477815fd5e0a9d...
📝 Creating event #5...
✅ Published event #5: 9e9dd6f79ef521d1...
🎉 Finished publishing 5 events
⏰ SSE streaming timeout reached
🎉 Worker threads completed. Events received: 0, published: 5
🔧 Testing Event Publishing...
📝 Created test event: {
id: '86885020b165014ca50b1bcedf9e882ba5f5095d19b897f3f07393b8ac613c31',
pubkey: 'fd208ee8c8f283780a9552896e4823cc9dc6bfd442063889577106940fd927c1',
kind: 1,
content: 'Test event from GitRepublic Web GUI - 2025-06-28T0...'
}
📤 Publishing event...
✅ Event published successfully
📄 Response: "event accepted"
🔍 Testing Event Retrieval...
📊 Found 5 events
✅ Retrieved 5 events successfully
1. 2c765e27f763d9dd... (kind 1)
2. 73fa0869485f69bb... (kind 1)
3. ef913a004b96dc8e... (kind 1)
4. 8e2b5f70f842f00d... (kind 1)
5. 4f63f481f8565843... (kind 1)
🔍 Testing Server-Sent Events (SSE)...
✅ Generated NIP-98 authentication token
📤 Sending SSE subscription with filter: {"kinds":[1]}
✅ SSE endpoint accessible
📊 Status: 200
✅ SSE connection established (streaming endpoint)
📊 Test Results Summary:
HTTP REST: ✅ PASS
Event Publishing: ✅ PASS
Event Retrieval: ✅ PASS
WebSocket: ✅ PASS
Server-Sent Events: ✅ PASS
🎯 Overall: 5/5 interfaces working
🎉 Realy relay is fully functional and ready for GUI development!