-
Notifications
You must be signed in to change notification settings - Fork 1
Websocket Test Client
Welcome to the WebSocket Test Client for Nostr wiki page! This guide will help you understand how to use the WebSocket Test Client Chrome Extension to interact with Nostr relays and events.
The WebSocket Test Client is a useful tool for developers and users who wish to test and explore the Nostr network. It enables users to establish WebSocket connections to Nostr relays, send and receive messages, and inspect events in real-time.
- To install the WebSocket Test Client Chrome Extension, visit the Chrome Web Store and click on "Add to Chrome".
- Once installed, you can access the extension by clicking on its icon in the Chrome browser's toolbar.
- Open the WebSocket Test Client extension.
- In the URL field, enter the WebSocket address of the Nostr relay you want to connect to (e.g.,
ws://your-nostr-relay.example.com). - Click the "Connect" button to establish a WebSocket connection.
- After connecting to a Nostr relay, you can send subscription requests to receive specific types of events.
- In the "Message" section, select "Text" and enter a subscription request in JSON format, for example:
["REQ", "your_subscription_id", {"types": [0, 1]}]Replace your_subscription_id with a unique identifier for your subscription.
- Click the "Send" button to send the subscription request.
- Once subscribed, you'll start receiving Nostr events that match your subscription request.
- Incoming messages will appear in the "Received messages" section, where you can inspect the event data and details.
- To publish a Nostr event, create a JSON-formatted message representing the event, for example:
{
"content": "hello world",
"created_at": 1683438945,
"id": "302944bc70fecbfefc88907a46d276d47c6446e7b34085f66318eee27a4577ca",
"kind": 1,
"pubkey": "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",
"sig": "f4756eb315fcad23613726c1bca3f328c763dd1d1031bb200f037441afc70e06a95d0c945f3064340d0d445c0c285373cc018dfb31c30ed784a4d884c9277e0b",
"tags": []
}Replace the placeholder values with the actual event data. Additionally NAK can be used to generate test events.
- In the "Message" section, select "Text" and enter the JSON-formatted message.
- Click the "Send" button to publish the event.
- When you're finished testing, click the "Disconnect" button to close the WebSocket connection.
The WebSocket Test Client Chrome Extension is a valuable tool for exploring the Nostr network, testing relays, and inspecting events. We hope this guide has been helpful in demonstrating how to use the extension for Nostr-related purposes. If you have any questions or suggestions, feel free to reach out to the Nostr community or open an issue on the project's GitHub repository. Happy exploring!
Thank you for visiting our project's wiki! We hope you found the information useful. If you have any questions or suggestions, please feel free to open an issue or submit a pull request. We appreciate your contribution and support!